@@ -131,11 +131,17 @@ jobs:
131131 env :
132132 ARCHITECTURE : ' ${{ matrix.arch }}'
133133 DOCKER_TAG : ' ${{ inputs.docker_tag }}'
134- - name : Push tagged image
134+ - name : Push tagged image and rebuild for github actions
135135 run : |
136136 echo "Pushing image..."
137137 docker push "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-${ARCHITECTURE}"
138138 echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-${ARCHITECTURE}" >> "$GITHUB_STEP_SUMMARY"
139+
140+ echo "Rebuilding image for github actions with tag githubactions-${DOCKER_TAG}-${ARCHITECTURE}"
141+ make build-githubactions-image BASE_IMAGE_NAME="${CONTAINER_NAME}" BASE_IMAGE_TAG="${DOCKER_TAG}-${ARCHITECTURE}" IMAGE_TAG="${DOCKER_TAG}-${ARCHITECTURE}" NO_CACHE="${{ inputs.NO_CACHE }}"
142+ echo "Pushing github actions image..."
143+ docker push "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}-${ARCHITECTURE}"
144+ echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}-${ARCHITECTURE}" >> "$GITHUB_STEP_SUMMARY"
139145 env :
140146 DOCKER_TAG : ${{ inputs.docker_tag }}
141147 CONTAINER_NAME : ' ${{ inputs.container_name }}'
@@ -144,9 +150,14 @@ jobs:
144150 if : ${{ inputs.tag_latest }}
145151 run : |
146152 docker tag "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-${ARCHITECTURE}" "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-${ARCHITECTURE}"
147- echo "Pushing image..."
153+ echo "Pushing latest image..."
148154 docker push "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-${ARCHITECTURE}"
149155 echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-${ARCHITECTURE}" >> "$GITHUB_STEP_SUMMARY"
156+
157+ docker tag "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}-${ARCHITECTURE}" "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest-${ARCHITECTURE}"
158+ echo "Pushing github actions latest image..."
159+ docker push "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest-${ARCHITECTURE}"
160+ echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest-${ARCHITECTURE}" >> "$GITHUB_STEP_SUMMARY"
150161 env :
151162 DOCKER_TAG : ${{ inputs.docker_tag }}
152163 CONTAINER_NAME : ' ${{ inputs.container_name }}'
@@ -172,6 +183,7 @@ jobs:
172183 run : |
173184 BUILD_TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
174185 export BUILD_TIMESTAMP
186+ echo "Creating combined image for tag ${DOCKER_TAG}"
175187 docker buildx imagetools create \
176188 --annotation "index:org.opencontainers.image.source=https://github.com/NHSDigital/eps-devcontainers" \
177189 --annotation "index:org.opencontainers.image.description=EPS devcontainer ${CONTAINER_NAME}:${DOCKER_TAG}" \
@@ -184,17 +196,39 @@ jobs:
184196 "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-amd64" \
185197 "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-arm64"
186198 echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}" >> "$GITHUB_STEP_SUMMARY"
199+
200+ echo "Creating combined image for tag githubactions-${DOCKER_TAG}"
201+ docker buildx imagetools create \
202+ --annotation "index:org.opencontainers.image.source=https://github.com/NHSDigital/eps-devcontainers" \
203+ --annotation "index:org.opencontainers.image.description=EPS devcontainer ${CONTAINER_NAME}:${DOCKER_TAG}" \
204+ --annotation "index:org.opencontainers.image.licenses=MIT" \
205+ --annotation "index:org.opencontainers.image.version=${DOCKER_TAG}" \
206+ --annotation "index:org.opencontainers.image.containerName=${CONTAINER_NAME}" \
207+ --annotation "index:org.opencontainers.image.created=${BUILD_TIMESTAMP}" \
208+ --annotation "index:org.opencontainers.image.authors=NHS England EPS Team" \
209+ --tag "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}" \
210+ "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}-amd64" \
211+ "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}-arm64"
212+ echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}" >> "$GITHUB_STEP_SUMMARY"
187213 env :
188214 DOCKER_TAG : ${{ inputs.docker_tag }}
189215 CONTAINER_NAME : ' ${{ inputs.container_name }}'
190216
191217 - name : Push multi-arch latest image
192218 if : ${{ inputs.tag_latest }}
193219 run : |
220+ echo "Creating combined image for tag latest"
194221 docker buildx imagetools create -t "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest" \
195222 "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-amd64" \
196223 "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-arm64"
197224 echo "## PUSHED COMBINED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest" >> "$GITHUB_STEP_SUMMARY"
225+
226+ echo "Creating combined image for tag githubactions-latest"
227+ docker buildx imagetools create -t "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest" \
228+ "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest-amd64" \
229+ "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest-arm64"
230+ echo "## PUSHED COMBINED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest" >> "$GITHUB_STEP_SUMMARY"
231+
198232 env :
199233 DOCKER_TAG : ${{ inputs.docker_tag }}
200234 CONTAINER_NAME : ' ${{ inputs.container_name }}'
0 commit comments