From c76d63a58c0f6ff23de477a63d078762e79de2d7 Mon Sep 17 00:00:00 2001 From: Avior Date: Fri, 30 Aug 2024 12:18:19 +0200 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57f24dce6..4876a033c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,9 @@ on: jobs: build_amd: runs-on: ubuntu-latest + outputs: + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} steps: - name: Checkout @@ -53,7 +56,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build and push + - name: Build and push AMD64 image uses: docker/build-push-action@v6 with: context: . @@ -64,8 +67,11 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max + build_arm: runs-on: ubuntu-latest + needs: build_amd # Ensures ARM64 build waits for AMD64 to finish + # if: github.event_name != 'pull_request' # Optional: Skip ARM64 build on PRs for faster feedback steps: - name: Checkout @@ -80,14 +86,8 @@ jobs: images: | ghcr.io/tcgdex/server tcgdex/server - tags: | - type=edge - type=ref,event=pr - type=ref,event=branch,prefix=branch- - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=semver,pattern=latest + tags: ${{ needs.build_amd.outputs.tags }} + labels: ${{ needs.build_amd.outputs.labels }} - name: Login to Docker Hub uses: docker/login-action@v3 @@ -104,21 +104,22 @@ jobs: password: ${{ secrets.DOCKER_TOKEN }} if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} - - - name: Set up QEMU + - name: Set up QEMU for ARM emulation uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + install: true - - name: Build and push + - name: Build and push ARM64 image uses: docker/build-push-action@v6 with: context: . platforms: linux/arm64 push: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} file: ./Dockerfile - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ needs.build_amd.outputs.tags }} + labels: ${{ needs.build_amd.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max