@@ -117,24 +117,7 @@ jobs:
117117 type=semver,pattern={{major}}.{{minor}},enable=${{ github.ref_type == 'tag' }}
118118 type=sha,format=long,prefix=,priority=1000
119119
120- - name : Build and push image (pull request)
121- if : github.event_name == 'pull_request'
122- id : build-pr
123- uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
124- with :
125- context : .
126- file : cmd/fluent-manager/Dockerfile
127- platforms : ${{ matrix.platform }}
128- labels : ${{ steps.image-metadata.outputs.labels }}
129- provenance : false
130- cache-from : type=gha
131- cache-to : type=gha,mode=max
132- build-args : |
133- GO_VERSION=${{ steps.setup-go.outputs.go-version }}
134- outputs : type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true
135-
136120 - name : Build and push image
137- if : github.event_name != 'pull_request'
138121 id : build
139122 uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
140123 with :
@@ -147,18 +130,20 @@ jobs:
147130 cache-to : type=gha,mode=max
148131 build-args : |
149132 GO_VERSION=${{ steps.setup-go.outputs.go-version }}
150- outputs : type=image,"name=${{ env.GHCR_REPO }},${{ env.DOCKERHUB_REPO }}",push-by-digest=true,name-canonical=true,push=true
133+ push : ${{ github.event_name != 'pull_request' }}
134+ outputs : ${{ github.event_name != 'pull_request' && format('type=image,"name={0},{1}",push-by-digest=true,name-canonical=true,push=true', env.GHCR_REPO, env.DOCKERHUB_REPO) || '' }}
151135
152136 - name : Output image digests
153137 id : output-digests
154138 run : |
155139 platform="${{ matrix.platform }}"
156140 # Convert "linux/amd64" to just amd64 for the output variable name
157141 arch=${platform#linux/}
158- echo "${arch}=${{ steps.build-pr.outputs.digest || steps.build .outputs.digest }}" >> $GITHUB_OUTPUT
142+ echo "${arch}=${{ steps.build.outputs.digest }}" >> $GITHUB_OUTPUT
159143
160144 manifest :
161145 name : Publish image manifest
146+ if : github.event_name != 'pull_request'
162147 runs-on : ubuntu-latest
163148 needs : [build]
164149 steps :
0 commit comments