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 }}