File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
1114env :
1215 BRANCH_NAME : ' ${{ github.event.pull_request.head.ref }}'
1316jobs :
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
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
6166 docker_tag : ${{ inputs.docker_tag }}
6267 container_name : ${{ matrix.container_name }}
6368 base_folder : " projects"
69+ push_image : ${{ inputs.push_image }}
Original file line number Diff line number Diff 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
1821jobs :
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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 4545 with :
4646 docker_tag : ' ${{ needs.tag_release.outputs.version_tag }}'
4747 tag_latest : true
48+ push_image : true
You can’t perform that action at this time.
0 commit comments