@@ -303,13 +303,13 @@ jobs:
303303 file : ${{ matrix.dockerfile }}
304304 platforms : ${{ matrix.platforms }}
305305 build-args : ${{ matrix.build-args }}
306- push : true
306+ push : ${{ github.ref == 'refs/heads/master' || github.ref_type == 'tag' }}
307307 tags : ${{ steps.meta.outputs.tags }}
308308 labels : ${{ steps.meta.outputs.labels }}
309309
310310 # Docker Hub mirror push - separate step
311311 - name : Tag and Push to Docker Hub Mirror
312- if : vars.ENABLE_DOCKERHUB_MIRROR == 'true'
312+ if : vars.ENABLE_DOCKERHUB_MIRROR == 'true' && (github.ref == 'refs/heads/master' || github.ref_type == 'tag')
313313 run : |
314314 echo "${{ steps.meta.outputs.tags }}" | while read -r TAG; do
315315 if [ -n "$TAG" ]; then
@@ -320,6 +320,7 @@ jobs:
320320
321321 manifest :
322322 needs : build
323+ if : github.ref == 'refs/heads/master' || github.ref_type == 'tag'
323324 runs-on : ubuntu-latest
324325 strategy :
325326 matrix :
@@ -443,7 +444,7 @@ jobs:
443444 context : .
444445 file : ${{ matrix.dockerfile }}
445446 platforms : ${{ matrix.platforms }}
446- push : true
447+ push : ${{ github.ref == 'refs/heads/master' || github.ref_type == 'tag' }}
447448 tags : ${{ steps.meta.outputs.tags }}
448449 labels : ${{ steps.meta.outputs.labels }}
449450 build-args : |
@@ -452,7 +453,7 @@ jobs:
452453
453454 # Mirror registry push
454455 - name : Tag and Push to Mirror
455- if : vars.ENABLE_DOCKERHUB_MIRROR == 'true'
456+ if : vars.ENABLE_DOCKERHUB_MIRROR == 'true' && (github.ref == 'refs/heads/master' || github.ref_type == 'tag')
456457 run : |
457458 echo "${{ steps.meta.outputs.tags }}" | while read -r TAG; do
458459 if [ -n "$TAG" ]; then
@@ -463,6 +464,7 @@ jobs:
463464
464465 manifest-fat :
465466 needs : build-fat
467+ if : github.ref == 'refs/heads/master' || github.ref_type == 'tag'
466468 runs-on : ubuntu-latest
467469 strategy :
468470 matrix :
0 commit comments