@@ -26,55 +26,64 @@ jobs:
2626 # echo "commit_id=${{ github.sha }}" >> "$GITHUB_ENV"
2727 echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT"
2828 echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
29- get_asdf_version :
29+ get_config_values :
3030 runs-on : ubuntu-22.04
3131 outputs :
32- asdf_version : ${{ steps.asdf-version.outputs.version }}
3332 tag_format : ${{ steps.load-config.outputs.TAG_FORMAT }}
33+ devcontainer_version : ${{ steps.load-config.outputs.DEVCONTAINER_VERSION }}
34+ devcontainer_image : ${{ steps.load-config.outputs.DEVCONTAINER_IMAGE }}
3435 steps :
3536 - name : Checkout code
3637 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
3738
38- - name : Get asdf version
39- id : asdf-version
40- run : echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"
4139 - name : Load config value
4240 id : load-config
4341 run : |
4442 TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
45- echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
43+ DEVCONTAINER_IMAGE=$(jq -r '.build.args.IMAGE_NAME' .devcontainer/devcontainer.json)
44+ DEVCONTAINER_VERSION=$(jq -r '.build.args.IMAGE_VERSION' .devcontainer/devcontainer.json)
45+ {
46+ echo "TAG_FORMAT=$TAG_FORMAT"
47+ echo "DEVCONTAINER_IMAGE=$DEVCONTAINER_IMAGE"
48+ echo "DEVCONTAINER_VERSION=$DEVCONTAINER_VERSION"
49+ } >> "$GITHUB_OUTPUT"
4650 quality_checks :
47- uses : NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@d215f841eb18b803e339e4ed597ed1f30e086e17
48- needs : [get_asdf_version , get_commit_id]
51+ uses : NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer .yml@36677e1d6bfaa010d7b78942a1ade12fbefecb80
52+ needs : [get_config_values , get_commit_id]
4953 with :
50- asdfVersion : ${{ needs.get_asdf_version .outputs.asdf_version }}
54+ runtime_docker_image : " ${{ needs.get_config_values .outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }} "
5155 run_docker_scan : true
5256 docker_images : " eps-cdk-utils"
5357 secrets :
5458 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
5559
5660 tag_release :
57- needs : [quality_checks, get_commit_id, get_asdf_version ]
58- uses : NHSDigital/eps-common-workflows/.github/workflows/tag-release.yml@d215f841eb18b803e339e4ed597ed1f30e086e17
61+ needs : [quality_checks, get_commit_id, get_config_values ]
62+ uses : NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer .yml@36677e1d6bfaa010d7b78942a1ade12fbefecb80
5963 with :
6064 dry_run : true
61- asdfVersion : ${{ needs.get_asdf_version .outputs.asdf_version }}
65+ runtime_docker_image : " ${{ needs.get_config_values .outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }} "
6266 branch_name : main
6367 publish_packages : packages/cdkConstructs,packages/deploymentUtils
64- tag_format : ${{ needs.get_asdf_version.outputs.tag_format }}
68+ tag_format : ${{ needs.get_config_values.outputs.tag_format }}
69+ verify_published_from_main_image : true
6570 secrets : inherit
6671
6772 package_code :
68- needs : [tag_release, quality_checks, get_commit_id]
73+ needs : [tag_release, quality_checks, get_commit_id, get_config_values ]
6974 uses : ./.github/workflows/docker_image_build.yml
7075 with :
76+ runtime_docker_image : " ${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
77+ verify_published_from_main_image : true
7178 VERSION_NUMBER : pre-release-${{ needs.get_commit_id.outputs.sha_short }}
7279 COMMIT_ID : ${{ needs.get_commit_id.outputs.commit_id }}
7380
7481 release_dev :
75- needs : [tag_release, package_code, get_commit_id]
82+ needs : [tag_release, package_code, get_commit_id, get_config_values ]
7683 uses : ./.github/workflows/docker_image_upload.yml
7784 with :
85+ runtime_docker_image : " ${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
86+ verify_published_from_main_image : true
7887 AWS_ENVIRONMENT : dev
7988 VERSION_NUMBER : pre-release-${{ needs.get_commit_id.outputs.sha_short }}
8089 COMMIT_ID : ${{ needs.get_commit_id.outputs.commit_id }}
8493 CDK_PUSH_IMAGE_ROLE : ${{ secrets.DEV_CDK_PUSH_IMAGE_ROLE }}
8594
8695 release_qa :
87- needs : [tag_release, release_dev, package_code, get_commit_id]
96+ needs :
97+ [tag_release, release_dev, package_code, get_commit_id, get_config_values]
8898 uses : ./.github/workflows/docker_image_upload.yml
8999 with :
100+ runtime_docker_image : " ${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
101+ verify_published_from_main_image : true
90102 AWS_ENVIRONMENT : qa
91103 VERSION_NUMBER : pre-release-${{ needs.get_commit_id.outputs.sha_short }}
92104 COMMIT_ID : ${{ needs.get_commit_id.outputs.commit_id }}
@@ -96,9 +108,12 @@ jobs:
96108 CDK_PUSH_IMAGE_ROLE : ${{ secrets.QA_CDK_PUSH_IMAGE_ROLE }}
97109
98110 release_ref :
99- needs : [tag_release, release_dev, package_code, get_commit_id]
111+ needs :
112+ [tag_release, release_dev, package_code, get_commit_id, get_config_values]
100113 uses : ./.github/workflows/docker_image_upload.yml
101114 with :
115+ runtime_docker_image : " ${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
116+ verify_published_from_main_image : true
102117 AWS_ENVIRONMENT : ref
103118 VERSION_NUMBER : pre-release-${{ needs.get_commit_id.outputs.sha_short }}
104119 COMMIT_ID : ${{ needs.get_commit_id.outputs.commit_id }}
@@ -108,5 +123,8 @@ jobs:
108123 CDK_PUSH_IMAGE_ROLE : ${{ secrets.REF_CDK_PUSH_IMAGE_ROLE }}
109124
110125 package_npm_code :
111- needs : [quality_checks, get_commit_id]
126+ needs : [quality_checks, get_commit_id, get_config_values ]
112127 uses : ./.github/workflows/package_npm_code.yml
128+ with :
129+ runtime_docker_image : " ${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
130+ verify_published_from_main_image : true
0 commit comments