Skip to content

Commit 5fc96df

Browse files
committed
flag to push image
1 parent 167f759 commit 5fc96df

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/build_all_images.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ name: build_all_images
88
tag_latest:
99
required: true
1010
type: boolean
11+
push_image:
12+
required: true
13+
type: boolean
1114
env:
1215
BRANCH_NAME: '${{ github.event.pull_request.head.ref }}'
1316
jobs:
@@ -32,6 +35,7 @@ jobs:
3235
docker_tag: ${{ inputs.docker_tag }}
3336
container_name: base
3437
base_folder: "."
38+
push_image: ${{ inputs.push_image }}
3539
package_language_docker_images:
3640
needs:
3741
- package_base_docker_image
@@ -46,6 +50,7 @@ jobs:
4650
docker_tag: ${{ inputs.docker_tag }}
4751
container_name: ${{ matrix.container_name }}
4852
base_folder: "languages"
53+
push_image: ${{ inputs.push_image }}
4954
package_project_docker_images:
5055
needs:
5156
- package_language_docker_images
@@ -61,3 +66,4 @@ jobs:
6166
docker_tag: ${{ inputs.docker_tag }}
6267
container_name: ${{ matrix.container_name }}
6368
base_folder: "projects"
69+
push_image: ${{ inputs.push_image }}

.github/workflows/build_multi_arch_image.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ name: Build and push docker image
1414
base_folder:
1515
required: true
1616
type: string
17+
push_image:
18+
required: true
19+
type: boolean
1720

1821
jobs:
1922
build_and_push_image:
@@ -127,6 +130,7 @@ jobs:
127130
ARCHITECTURE: '${{ matrix.arch }}'
128131
DOCKER_TAG: '${{ inputs.docker_tag }}'
129132
- name: Push tagged image
133+
if: ${{ inputs.push_image }}
130134
run: |
131135
echo "Pushing image..."
132136
docker push "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-${ARCHITECTURE}"
@@ -135,7 +139,7 @@ jobs:
135139
CONTAINER_NAME: '${{ inputs.container_name }}'
136140
ARCHITECTURE: '${{ matrix.arch }}'
137141
- name: Push latest image
138-
if: ${{ inputs.tag_latest }}
142+
if: ${{ inputs.tag_latest && inputs.push_image }}
139143
run: |
140144
docker tag "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-${ARCHITECTURE}" "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-${ARCHITECTURE}"
141145
echo "Pushing image..."
@@ -146,6 +150,7 @@ jobs:
146150
ARCHITECTURE: '${{ matrix.arch }}'
147151

148152
publish_combined_image:
153+
if: ${{ inputs.push_image }}
149154
name: Publish image for ${{ inputs.container_name }}
150155
runs-on: ubuntu-22.04
151156
needs: build_and_push_image

.github/workflows/pull_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,4 @@ jobs:
9292
with:
9393
docker_tag: 'pr-${{ needs.get_issue_number.outputs.issue_number }}-${{ needs.get_commit_id.outputs.sha_short }}'
9494
tag_latest: false
95+
push_image: true

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ jobs:
4545
with:
4646
docker_tag: '${{ needs.tag_release.outputs.version_tag }}'
4747
tag_latest: true
48+
push_image: true

0 commit comments

Comments
 (0)