File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 push : # publish to `main` tag on Docker Hub on merge to main: https://hub.docker.com/layers/cipherstash/proxy/main
44 branches :
55 - main
6+ pull_request : # run the release workflow when changes are made to it in PRs
7+ branches :
8+ - main
9+ paths :
10+ - ' .github/workflows/release.yml'
611 release : # for cutting a numbered release (e.g. v2.1.9)
712 types : [published]
813 workflow_dispatch : # for running the workflow on an arbitrary branch or commit
@@ -107,6 +112,8 @@ jobs:
107112 timeout-minutes : 30
108113 needs :
109114 - build
115+ env :
116+ publish : ${{contains(fromJSON('["push", "release"]'), github.event_name)}}
110117 steps :
111118 - uses : actions/checkout@v4
112119
@@ -151,15 +158,19 @@ jobs:
151158
152159 - name : Create manifest list and push
153160 working-directory : ${{ runner.temp }}/digests
161+ env :
162+ DRY_RUN : ${{case(fromJSON(env.publish),' ','--dry-run')}} # run the `docker buildx` command with --dry-run if we're not publishing a release
154163 run : |
155- docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
164+ docker buildx imagetools create ${{ env.DRY_RUN }} $ (jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
156165 $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
157166
158167 - name : Inspect image
168+ if : ${{ fromJSON(env.publish) }}
159169 run : |
160170 docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
161171
162172 - name : Notify Multitudes
173+ if : ${{ fromJSON(env.publish) }}
163174 run : |
164175 curl --request POST \
165176 --fail-with-body \
You can’t perform that action at this time.
0 commit comments