Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/actions/build-proxies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ inputs:
releaseVersion:
description: "Release, tag, branch, or commit ID to be used for deployment"
required: true
isRelease:
description: "True if releaseVersion is a release tag (if set, downloads from release assets instead of workflow artifacts)"
required: false
default: false
environment:
description: "Deployment environment"
required: true
Expand All @@ -30,12 +34,29 @@ runs:
using: composite

steps:
- name: Download OAS Spec artifact
- name: Download OAS Spec artifact from workflow
if: ${{ inputs.isRelease == 'false' }}
uses: actions/download-artifact@v4
with:
name: api-oas-specification-${{ inputs.apimEnv }}${{ inputs.version != '' && format('-{0}', inputs.version) || '' }}
path: ./build

- name: Download OAS Spec artifact from release
if: ${{ inputs.isRelease == 'true' }}
shell: bash
run: |
mkdir ./build
ASSET_PATTERN="api-oas-specification-${{ inputs.apimEnv }}-*.zip"
gh release download "${{ inputs.releaseVersion }}" \
--pattern "$ASSET_PATTERN" \
--dir ./build
# Unzip the downloaded file (there should be exactly one match)
ASSET_FILE=$(ls ./build/api-oas-specification-${{ inputs.apimEnv }}-*.zip)
unzip "$ASSET_FILE" -d ./build
rm "$ASSET_FILE"
env:
GH_TOKEN: ${{ github.token }}

- name: Setup Proxy Name and target
shell: bash
run: |
Expand Down
34 changes: 28 additions & 6 deletions .github/workflows/release_created.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ jobs:
id-token: write
contents: read

strategy:
max-parallel: 1
matrix:
component: [api]

steps:
- name: Checkout repository
uses: actions/checkout@v5
Expand All @@ -36,5 +31,32 @@ jobs:
--targetWorkflow "dispatch-deploy-static-notify-supplier-api-env.yaml" \
--targetEnvironment "main" \
--targetAccountGroup "nhs-notify-supplier-api-nonprod" \
--targetComponent "${{ matrix.component }}" \
--targetComponent "api" \
--terraformAction "apply"
deploy-proxy:
name: "Deploy proxy"
runs-on: ubuntu-latest
timeout-minutes: 10

permissions:
id-token: write
contents: read
actions: read

env:
PROXYGEN_API_NAME: nhs-notify-supplier
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}

steps:
- name: "Checkout code"
uses: actions/checkout@v5

- name: "Build proxies"
uses: ./.github/actions/build-proxies
with:
environment: "main"
apimEnv: "int"
runId: "${{ github.run_id }}"
releaseVersion: "${{ github.event.release.tag_name }}"
isRelease: true
Loading