From e13abe5f143f8cb1e5c80e8a3c135f1a66ccc81c Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Fri, 1 Dec 2023 09:29:16 +0100 Subject: [PATCH] only publish images when a release was made --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ad78f8..ee020e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - if: github.ref == 'refs/heads/main' + if: github.event_name == 'release' && github.event.action == 'published' - name: Build the container uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5 @@ -46,4 +46,4 @@ jobs: context: . push: true tags: ghcr.io/telekom-mms/docker-trivy-dojo-operator:latest,ghcr.io/telekom-mms/docker-trivy-dojo-operator:${{ github.event.release.tag_name }} - if: github.ref == 'refs/heads/main' + if: github.event_name == 'release' && github.event.action == 'published'