Skip to content

Commit 3fadd18

Browse files
committed
WIP
1 parent 20fe5ec commit 3fadd18

File tree

2 files changed

+51
-7
lines changed

2 files changed

+51
-7
lines changed

.github/actions/build-proxies/action.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ inputs:
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,30 @@ 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 -p ./build
49+
ASSET_PATTERN="api-oas-specification-${{ inputs.apimEnv }}-*.zip"
50+
echo "Downloading assets matching $ASSET_PATTERN from release ${{ inputs.releaseVersion }}"
51+
gh release download "${{ inputs.releaseVersion }}" \
52+
--pattern "$ASSET_PATTERN" \
53+
--dir ./build
54+
# Unzip the downloaded file (there should be exactly one match)
55+
ASSET_FILE=$(ls ./build/api-oas-specification-${{ inputs.apimEnv }}-*.zip)
56+
unzip -o "$ASSET_FILE" -d ./build
57+
rm "$ASSET_FILE"
58+
env:
59+
GH_TOKEN: ${{ github.token }}
60+
3961
- name: Setup Proxy Name and target
4062
shell: bash
4163
run: |

.github/workflows/release_created.yaml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ jobs:
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
@@ -36,5 +31,32 @@ jobs:
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

0 commit comments

Comments
 (0)