diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 547e03c..0cc27d5 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,4 +1,4 @@ -name: Docker +name: Docker_ghcr_on_release # This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by @@ -6,11 +6,9 @@ name: Docker # documentation. on: - push: - branches: [ main ] - # Publish semver tags as releases. - tags: [ 'v*.*.*' ] - pull_request: + release: + types: published + pull_request: branches: [ main ] env: @@ -38,6 +36,7 @@ jobs: # Install the cosign tool except on PR # https://github.com/sigstore/cosign-installer - name: Install cosign + if: github.event_name != 'pull_request' uses: sigstore/cosign-installer@1e95c1de343b5b0c23352d6417ee3e48d5bcd422 with: cosign-release: 'v1.4.0' @@ -50,6 +49,7 @@ jobs: # Login against a Docker registry except on PR # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c with: registry: ${{ env.REGISTRY }} @@ -71,5 +71,6 @@ jobs: uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}