File tree Expand file tree Collapse file tree 2 files changed +50
-7
lines changed
Expand file tree Collapse file tree 2 files changed +50
-7
lines changed Original file line number Diff line number Diff line change 88 releaseVersion :
99 description : " Release, tag, branch, or commit ID to be used for deployment"
1010 required : true
11+ isRelease :
12+ description : " True if releaseVersion is a release tag (if set, downloads from release assets instead of workflow artifacts)"
13+ required : false
14+ default : false
1115 environment :
1216 description : " Deployment environment"
1317 required : true
@@ -30,12 +34,29 @@ runs:
3034 using : composite
3135
3236 steps :
33- - name : Download OAS Spec artifact
37+ - name : Download OAS Spec artifact from workflow
38+ if : ${{ inputs.isRelease == 'false' }}
3439 uses : actions/download-artifact@v4
3540 with :
3641 name : api-oas-specification-${{ inputs.apimEnv }}${{ inputs.version != '' && format('-{0}', inputs.version) || '' }}
3742 path : ./build
3843
44+ - name : Download OAS Spec artifact from release
45+ if : ${{ inputs.isRelease == 'true' }}
46+ shell : bash
47+ run : |
48+ mkdir ./build
49+ ASSET_PATTERN="api-oas-specification-${{ inputs.apimEnv }}-*.zip"
50+ gh release download "${{ inputs.releaseVersion }}" \
51+ --pattern "$ASSET_PATTERN" \
52+ --dir ./build
53+ # Unzip the downloaded file (there should be exactly one match)
54+ ASSET_FILE=$(ls ./build/api-oas-specification-${{ inputs.apimEnv }}-*.zip)
55+ unzip "$ASSET_FILE" -d ./build
56+ rm "$ASSET_FILE"
57+ env :
58+ GH_TOKEN : ${{ github.token }}
59+
3960 - name : Setup Proxy Name and target
4061 shell : bash
4162 run : |
Original file line number Diff line number Diff line change 1717 id-token : write
1818 contents : read
1919
20- strategy :
21- max-parallel : 1
22- matrix :
23- component : [api]
24-
2520 steps :
2621 - name : Checkout repository
2722 uses : actions/checkout@v5
3631 --targetWorkflow "dispatch-deploy-static-notify-supplier-api-env.yaml" \
3732 --targetEnvironment "main" \
3833 --targetAccountGroup "nhs-notify-supplier-api-nonprod" \
39- --targetComponent "${{ matrix.component }} " \
34+ --targetComponent "api " \
4035 --terraformAction "apply"
36+ deploy-proxy :
37+ name : " Deploy proxy"
38+ runs-on : ubuntu-latest
39+ timeout-minutes : 10
40+
41+ permissions :
42+ id-token : write
43+ contents : read
44+ actions : read
45+
46+ env :
47+ PROXYGEN_API_NAME : nhs-notify-supplier
48+ APP_CLIENT_ID : ${{ secrets.APP_CLIENT_ID }}
49+ APP_PEM_FILE : ${{ secrets.APP_PEM_FILE }}
50+
51+ steps :
52+ - name : " Checkout code"
53+ uses : actions/checkout@v5
54+
55+ - name : " Build proxies"
56+ uses : ./.github/actions/build-proxies
57+ with :
58+ environment : " main"
59+ apimEnv : " int"
60+ runId : " ${{ github.run_id }}"
61+ releaseVersion : " ${{ github.event.release.tag_name }}"
62+ isRelease : true
You can’t perform that action at this time.
0 commit comments