From 077150ad9cf7dd90d847811fb1cac5c7c675cffa Mon Sep 17 00:00:00 2001 From: Patrick Fuhrmann Date: Thu, 25 Jul 2024 10:36:32 +0200 Subject: [PATCH] Pushing to the GitHub Container Registry only on 'push' not on 'pr' --- .github/workflows/deploy.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2d55b86..0691dce 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -34,19 +34,9 @@ jobs: tags: type=sha,format=long,prefix= # adds : tag to outputs.tags - name: Build and push - if: github.ref == 'refs/heads/master' uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64,linux/arm64/v8 - push: true - tags: ${{ steps.meta.outputs.tags }} - - - name: Build and push - if: github.ref != 'refs/heads/master' - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64,linux/arm64/v8 - push: false + push: ${{github.event_name == 'push' }} tags: ${{ steps.meta.outputs.tags }}