Skip to content

Commit 2740467

Browse files
authored
feat: add skip_push flag to build-docker-artifacts (#206)
1 parent f323930 commit 2740467

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/build-docker-artifacts.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
required: false
1919
# When using github.ref || github.head_ref, it would contain the full path, including /, which breaks the postgres hostname
2020
default: ${{ github.sha }}
21+
skip_push:
22+
type: boolean
23+
required: false
24+
default: false
2125
fail_fast:
2226
type: boolean
2327
required: false
@@ -267,6 +271,7 @@ jobs:
267271
continue-on-error: false
268272

269273
- name: Push image
274+
if: ${{ inputs.skip_push != true }}
270275
# Instead of the docker/build-push-action@v6 which will rebuild the image, just push it directly
271276
run: docker push ${{ vars.DV_AWS_ECR_REGISTRY }}/${{ matrix.component.ecr_repository }}:${{ matrix.component.image_tag }}
272277

@@ -277,6 +282,7 @@ jobs:
277282
retag-images:
278283
name: Retag images of flavor ${{ matrix.flavor || 'default' }}
279284
needs: [get-flavors, build-flavors]
285+
if: ${{ inputs.skip_push != true }}
280286
strategy:
281287
fail-fast: false
282288
matrix:
@@ -336,7 +342,7 @@ jobs:
336342
push-to-repositories:
337343
name: Push images to push targets
338344
# if? When should we do this? Always? Only for certain branches? If so, how should we define that, in the config.json?
339-
if: ${{ fromJson(needs.get-flavors.outputs.result).push_to != '' }}
345+
if: ${{ inputs.skip_push != true && fromJson(needs.get-flavors.outputs.result).push_to != '' }}
340346
needs: [retag-images, get-flavors]
341347
uses: datavisyn/github-workflows/.github/workflows/build-docker-artifacts-trigger-push.yml@main
342348
secrets: inherit

0 commit comments

Comments
 (0)