From 90a22623601a2a6f8bd67540ee85c348268e2d34 Mon Sep 17 00:00:00 2001 From: Nano Taboada <87288+nanotaboada@users.noreply.github.com> Date: Sat, 10 May 2025 10:38:59 -0300 Subject: [PATCH] chore(ci): limit container job to master branch pushes --- .github/workflows/dotnet.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d5df019..238c26c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -109,6 +109,7 @@ jobs: container: needs: coverage runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} permissions: contents: read @@ -128,12 +129,15 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build and push Docker image to GHCR + - name: Build and push Docker image to GitHub Container Registry uses: docker/build-push-action@v6 with: context: . push: true + platforms: linux/amd64 + provenance: false + cache-from: type=gha + cache-to: type=gha,mode=max tags: | ghcr.io/${{ env.PACKAGE_NAME }}:latest - ghcr.io/${{ env.PACKAGE_NAME }}:main ghcr.io/${{ env.PACKAGE_NAME }}:sha-${{ github.sha }}