From dd51bf58a7a1e4219e57087539dc087568db2c39 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Wed, 17 Apr 2024 22:20:00 +0100 Subject: [PATCH] Build arm64 on GHA using QEMU --- .github/workflows/build.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efb946ee..e547e81f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,8 +37,8 @@ jobs: - name: Checkout Repo ⚡️ uses: actions/checkout@v4 - #- name: Set up QEMU - #uses: docker/setup-qemu-action@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -50,7 +50,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Generate tags for images on ghcr.io + - name: Generate tags for images on ghcr.io 🏷️ id: tags_template uses: docker/metadata-action@v4 with: @@ -68,12 +68,11 @@ jobs: .github/workflows/merge-bake-template-target.sh ${BAKE_TEMPLATE_FILE} \ | tee docker-bake-template-meta.json - - name: Build image + - name: Build images and upload to ghcr.io 📤 id: build uses: docker/bake-action@v4 with: push: true - load: false # Using provenance to disable default attestation so it will build only desired images: # https://github.com/orgs/community/discussions/45969 provenance: false @@ -82,6 +81,21 @@ jobs: build.json docker-bake-template-meta.json + - name: Build images for ARM64 🍎 + id: build-arm64 + uses: docker/bake-action@v4 + with: + push: true + # Using provenance to disable default attestation so it will build only desired images: + # https://github.com/orgs/community/discussions/45969 + provenance: false + set: | + *.platform=linux/arm64 + files: | + docker-bake.hcl + build.json + docker-bake-template-meta.json + - name: Set output variables id: bake_metadata run: |