From d184fef5c0ce46067667082552cfacddc7c696b4 Mon Sep 17 00:00:00 2001 From: Louis Orleans Date: Thu, 31 Aug 2023 16:27:50 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20build=20for=20ARM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-publish.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/build-publish.yaml b/.github/workflows/build-publish.yaml index 1425ffa..090faae 100644 --- a/.github/workflows/build-publish.yaml +++ b/.github/workflows/build-publish.yaml @@ -34,16 +34,31 @@ jobs: "${{ github.ref_type }}" \ "${{ github.event.repository.default_branch }}" \ )" >> "$GITHUB_OUTPUT" + + - name: 'Set up QEMU 🦅' + id: 'qemu' + uses: 'docker/setup-qemu-action@v2' + with: + platforms: 'arm64' + - name: 'Set target build platforms 📝' + id: 'target-platforms' + run: | + echo "target_platforms=linux/amd64,linux/${{ steps.qemu.outputs.platforms }}" >> "$GITHUB_OUTPUT" + - name: 'Build container 🐳' + id: 'build' uses: 'docker/build-push-action@v3' with: file: 'Dockerfile' tags: '${{ steps.tag-image.outputs.image_tags }}' + platforms: '${{ steps.target-platforms.outputs.target_platforms }}' cache-from: 'type=gha' cache-to: 'type=gha,mode=max' outputs: image_tags: '${{ steps.tag-image.outputs.image_tags }}' + qemu_platforms: '${{ steps.qemu.outputs.platforms }}' + docker_platforms: '${{ steps.target-platforms.outputs.target_platforms }}' publish: needs: @@ -63,10 +78,16 @@ jobs: username: '${{ github.repository_owner }}' password: '${{ secrets.GITHUB_TOKEN }}' + - name: 'Set up QEMU 🦅' + uses: 'docker/setup-qemu-action@v2' + with: + platforms: '${{ needs.container-build.outputs.qemu_platforms }}' + - name: 'Publish to Registry 💨' uses: 'docker/build-push-action@v3' with: file: 'Dockerfile' push: true tags: '${{ needs.container-build.outputs.image_tags }}' + platforms: '${{ needs.container-build.outputs.docker_platforms }}' cache-from: 'type=gha'