From 6652bad45b156f91c6ef1b7d7d49cc5ede6d16b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Sun, 30 May 2021 19:30:57 +0200 Subject: [PATCH] chore: Update GitHub actions to build images for multiple platforms --- .github/workflows/release_tag.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release_tag.yml b/.github/workflows/release_tag.yml index 3f83637..50d33d0 100644 --- a/.github/workflows/release_tag.yml +++ b/.github/workflows/release_tag.yml @@ -57,12 +57,19 @@ jobs: image_release: needs: build + if: ${{ success() }} && github.event_name != 'pull_request' runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 + - name: Set up Docker Buildx + uses: crazy-max/ghaction-docker-buildx@v3 + with: + buildx-version: latest + qemu-version: latest + - name: Login to DockerHub uses: docker/login-action@v1 with: @@ -76,8 +83,12 @@ jobs: tagRegex: "v(.*)" tagRegexGroup: 1 - - name: Docker build and push - uses: docker/build-push-action@v2 - with: - push: true - tags: tomasfarias/c2g:${{ steps.tagName.outputs.tag }},tomasfarias/c2g:latest + - name: Docker buildx and push + run: | + docker buildx build \ + --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \ + --output "type=image,push=true" \ + --tag tomasfarias/c2g:latest \ + --tag tomasfarias/c2g:${{ steps.tagName.outputs.tag }} \ + --file ./Dockerfile . +