3333 type : string
3434 description : " The tag to use for the dev container image."
3535 required : true
36- tag_latest :
37- type : boolean
38- description : " If true, the action will also tag the dev container image as 'latest' in ECR."
39- required : true
4036 check_ecr_image_scan_results_script_tag :
4137 type : string
4238 description : " The tag to download check_ecr_image_scan_results.sh script."
@@ -360,8 +356,10 @@ jobs:
360356 fetch-depth : 0
361357
362358 - name : Download check_ecr_image_scan_results.sh script
359+ env :
360+ SCRIPT_TAG : ${{ inputs.check_ecr_image_scan_results_script_tag }}
363361 run : |
364- curl -L https://raw.githubusercontent.com/NHSDigital/eps-workflow-quality-checks/refs/heads/${{inputs.check_ecr_image_scan_results_script_tag}} /.github/scripts/check_ecr_image_scan_results.sh -o check_ecr_image_scan_results.sh
362+ curl -L " https://raw.githubusercontent.com/NHSDigital/eps-workflow-quality-checks/refs/heads/${SCRIPT_TAG} /.github/scripts/check_ecr_image_scan_results.sh" -o check_ecr_image_scan_results.sh
365363 chmod +x check_ecr_image_scan_results.sh
366364 - name : Build dev container
367365 run : |
@@ -387,9 +385,13 @@ jobs:
387385 aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin ${{ steps.retrieve-deploy-account-id.outputs.account_id }}.dkr.ecr.eu-west-2.amazonaws.com
388386
389387 - name : Push x64 image to Amazon ECR
388+ env :
389+ ECR_REPOSITORY : ${{ inputs.dev_container_ecr }}
390+ IMAGE_TAG : ${{ inputs.dev_container_image_tag }}
391+ ACCOUNT_ID : ${{ steps.retrieve-deploy-account-id.outputs.account_id }}
390392 run : |
391- docker tag "dev-container-image" "${{ steps.retrieve-deploy-account-id.outputs.account_id }} .dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }} :${{ inputs.dev_container_image_tag } }-amd64"
392- docker push "${{ steps.retrieve-deploy-account-id.outputs.account_id }} .dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }} :${{ inputs.dev_container_image_tag } }-amd64"
393+ docker tag "dev-container-image" "${ACCOUNT_ID} .dkr.ecr.eu-west-2.amazonaws.com/${ECR_REPOSITORY} :${IMAGE_TAG }-amd64"
394+ docker push "${ACCOUNT_ID} .dkr.ecr.eu-west-2.amazonaws.com/${ECR_REPOSITORY} :${IMAGE_TAG }-amd64"
393395 - name : Check dev container scan results
394396 env :
395397 REPOSITORY_NAME : ${{ inputs.dev_container_ecr }}
@@ -410,9 +412,14 @@ jobs:
410412 fetch-depth : 0
411413
412414 - name : Download check_ecr_image_scan_results.sh script
415+ env :
416+ SCRIPT_TAG : ${{ inputs.check_ecr_image_scan_results_script_tag }}
413417 run : |
414- curl -L https://raw.githubusercontent.com/NHSDigital/eps-workflow-quality-checks/refs/heads/${{inputs.check_ecr_image_scan_results_script_tag}} /.github/scripts/check_ecr_image_scan_results.sh -o check_ecr_image_scan_results.sh
418+ curl -L " https://raw.githubusercontent.com/NHSDigital/eps-workflow-quality-checks/refs/heads/${SCRIPT_TAG} /.github/scripts/check_ecr_image_scan_results.sh" -o check_ecr_image_scan_results.sh
415419 chmod +x check_ecr_image_scan_results.sh
420+ - name : Build dev container
421+ run : |
422+ docker build -f .devcontainer/Dockerfile -t dev-container-image .
416423
417424 - name : Build dev container
418425 run : |
@@ -438,9 +445,13 @@ jobs:
438445 aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin ${{ steps.retrieve-deploy-account-id.outputs.account_id }}.dkr.ecr.eu-west-2.amazonaws.com
439446
440447 - name : Push ARM64 image to Amazon ECR
448+ env :
449+ ECR_REPOSITORY : ${{ inputs.dev_container_ecr }}
450+ IMAGE_TAG : ${{ inputs.dev_container_image_tag }}
451+ ACCOUNT_ID : ${{ steps.retrieve-deploy-account-id.outputs.account_id }}
441452 run : |
442- docker tag "dev-container-image-arm" "${{ steps.retrieve-deploy-account-id.outputs.account_id }} .dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }} :${{ inputs.dev_container_image_tag } }-arm64"
443- docker push "${{ steps.retrieve-deploy-account-id.outputs.account_id }} .dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }} :${{ inputs.dev_container_image_tag } }-arm64"
453+ docker tag "dev-container-image-arm" "${ACCOUNT_ID} .dkr.ecr.eu-west-2.amazonaws.com/${ECR_REPOSITORY} :${IMAGE_TAG }-arm64"
454+ docker push "${ACCOUNT_ID} .dkr.ecr.eu-west-2.amazonaws.com/${ECR_REPOSITORY} :${IMAGE_TAG }-arm64"
444455 - name : Check dev container scan results
445456 env :
446457 REPOSITORY_NAME : ${{ inputs.dev_container_ecr }}
@@ -480,21 +491,21 @@ jobs:
480491 aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin ${{ steps.retrieve-deploy-account-id.outputs.account_id }}.dkr.ecr.eu-west-2.amazonaws.com
481492
482493 - name : Create and push multi-architecture manifest for tag
494+ env :
495+ ECR_REPOSITORY : ${{ inputs.dev_container_ecr }}
496+ IMAGE_TAG : ${{ inputs.dev_container_image_tag }}
497+ ACCOUNT_ID : ${{ steps.retrieve-deploy-account-id.outputs.account_id }}
483498 run : |
484499 # Create manifest list combining both architectures
485- docker buildx imagetools create -t ${{ steps.retrieve-deploy-account-id.outputs.account_id }}.dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }}:${{ inputs.dev_container_image_tag }} \
486- ${{ steps.retrieve-deploy-account-id.outputs.account_id }}.dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }}:${{ inputs.dev_container_image_tag }}-amd64 \
487- ${{ steps.retrieve-deploy-account-id.outputs.account_id }}.dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }}:${{ inputs.dev_container_image_tag }}-arm64
488-
489- - name : Create and push multi-architecture manifest for latest tag
490- if : ${{ inputs.tag_latest == true }}
491- run : |
492- # Also create latest tag
493- docker buildx imagetools create -t ${{ steps.retrieve-deploy-account-id.outputs.account_id }}.dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }}:latest \
494- ${{ steps.retrieve-deploy-account-id.outputs.account_id }}.dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }}:${{ inputs.dev_container_image_tag }}-amd64 \
495- ${{ steps.retrieve-deploy-account-id.outputs.account_id }}.dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }}:${{ inputs.dev_container_image_tag }}-arm64
500+ docker buildx imagetools create -t "${ACCOUNT_ID}.dkr.ecr.eu-west-2.amazonaws.com/${ECR_REPOSITORY}:${IMAGE_TAG}" \
501+ "${ACCOUNT_ID}.dkr.ecr.eu-west-2.amazonaws.com/${ECR_REPOSITORY}:${IMAGE_TAG}-amd64" \
502+ "${ACCOUNT_ID}.dkr.ecr.eu-west-2.amazonaws.com/${ECR_REPOSITORY}:${IMAGE_TAG}-arm64"
496503
497504 - name : Verify multi-architecture manifest
505+ env :
506+ ECR_REPOSITORY : ${{ inputs.dev_container_ecr }}
507+ IMAGE_TAG : ${{ inputs.dev_container_image_tag }}
508+ ACCOUNT_ID : ${{ steps.retrieve-deploy-account-id.outputs.account_id }}
498509 run : |
499510 echo "=== Verifying multi-architecture manifest ==="
500- docker buildx imagetools inspect ${{ steps.retrieve-deploy-account-id.outputs.account_id }} .dkr.ecr.eu-west-2.amazonaws.com/${{ inputs.dev_container_ecr }} :${{ inputs.dev_container_image_tag }}
511+ docker buildx imagetools inspect "${ACCOUNT_ID} .dkr.ecr.eu-west-2.amazonaws.com/${ECR_REPOSITORY} :${IMAGE_TAG}"
0 commit comments