1919# GitHub runner.
2020
2121name : CI Docker
22+ permissions :
23+ contents : read
2224
2325on :
2426 pull_request :
25- branches : [master]
26- types : [opened, synchronize, reopened]
27+ branches :
28+ - master
29+ types :
30+ - opened
31+ - synchronize
32+ - reopened
2733 push :
28- branches : [master]
34+ branches :
35+ - master
2936 workflow_dispatch :
3037
3138concurrency :
@@ -97,10 +104,9 @@ jobs:
97104 solution : ${{ steps.find_dotnet.outputs.solution }}
98105
99106 setup_release :
100- if : ${{ needs.check_dockerfiles.outputs.dockerfiles }}
101107 name : Setup Release
102- needs :
103- - check_dockerfiles
108+ if : needs.check_dockerfiles.outputs.dockerfiles
109+ needs : check_dockerfiles
104110 outputs :
105111 publish_release : ${{ steps.setup_release.outputs.publish_release }}
106112 release_body : ${{ steps.setup_release.outputs.release_body }}
@@ -121,17 +127,18 @@ jobs:
121127 github_token : ${{ secrets.GITHUB_TOKEN }}
122128
123129 docker :
124- needs : [check_dockerfiles, setup_release]
125- if : ${{ needs.check_dockerfiles.outputs.dockerfiles }}
126- runs-on : ubuntu-22.04
130+ name : Docker${{ matrix.tag }}
131+ if : needs.check_dockerfiles.outputs.dockerfiles
132+ needs :
133+ - check_dockerfiles
134+ - setup_release
127135 permissions :
128136 packages : write
129137 contents : write
138+ runs-on : ubuntu-22.04
130139 strategy :
131140 fail-fast : false
132141 matrix : ${{ fromJson(needs.check_dockerfiles.outputs.matrix) }}
133- name : Docker${{ matrix.tag }}
134-
135142 steps :
136143 - name : Maximize build space
137144 uses : easimon/maximize-build-space@v10
@@ -256,22 +263,22 @@ jobs:
256263 Docker-buildx${{ matrix.tag }}-
257264
258265 - name : Log in to Docker Hub
259- if : ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets
266+ if : needs.setup_release.outputs.publish_release == 'true' # PRs do not have access to secrets
260267 uses : docker/login-action@v3
261268 with :
262269 username : ${{ secrets.DOCKER_HUB_USERNAME }}
263270 password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
264271
265272 - name : Log in to the Container registry
266- if : ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets
273+ if : needs.setup_release.outputs.publish_release == 'true' # PRs do not have access to secrets
267274 uses : docker/login-action@v3
268275 with :
269276 registry : ghcr.io
270277 username : ${{ secrets.GH_BOT_NAME }}
271278 password : ${{ secrets.GH_BOT_TOKEN }}
272279
273280 - name : Build artifacts
274- if : ${{ steps.prepare.outputs.artifacts == 'true' }}
281+ if : steps.prepare.outputs.artifacts == 'true'
275282 id : build_artifacts
276283 uses : docker/build-push-action@v6
277284 with :
@@ -314,7 +321,7 @@ jobs:
314321 no-cache-filters : ${{ steps.prepare.outputs.no_cache_filters }}
315322
316323 - name : Arrange Artifacts
317- if : ${{ steps.prepare.outputs.artifacts == 'true' }}
324+ if : steps.prepare.outputs.artifacts == 'true'
318325 working-directory : artifacts
319326 run : |
320327 # debug directory
@@ -336,14 +343,16 @@ jobs:
336343 rm -f ./provenance.json
337344
338345 - name : Upload Artifacts
339- if : ${{ steps.prepare.outputs.artifacts == 'true' }}
346+ if : steps.prepare.outputs.artifacts == 'true'
340347 uses : actions/upload-artifact@v4
341348 with :
342349 name : Docker${{ matrix.tag }}
343350 path : artifacts/
344351
345352 - name : Create/Update GitHub Release
346- if : ${{ needs.setup_release.outputs.publish_release == 'true' && steps.prepare.outputs.artifacts == 'true' }}
353+ if : >
354+ needs.setup_release.outputs.publish_release == 'true' &&
355+ steps.prepare.outputs.artifacts == 'true'
347356 uses : LizardByte/create-release-action@v2025.102.13208
348357 with :
349358 allowUpdates : true
@@ -356,7 +365,9 @@ jobs:
356365 token : ${{ secrets.GH_BOT_TOKEN }}
357366
358367 - name : Update Docker Hub Description
359- if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
368+ if : >
369+ github.event_name == 'push' &&
370+ github.ref == 'refs/heads/master'
360371 uses : peter-evans/dockerhub-description@v4
361372 with :
362373 username : ${{ secrets.DOCKER_HUB_USERNAME }}
0 commit comments