Skip to content

Commit 7e9712d

Browse files
initial attempt at git workflow
1 parent 229fe75 commit 7e9712d

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "Build Proxies"
2+
description: "Build Proxies"
3+
inputs:
4+
version:
5+
description: "Version number"
6+
required: true
7+
runs:
8+
using: composite
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 24
16+
17+
- name: Npm install
18+
working-directory: .
19+
run: npm ci
20+
shell: bash
21+
22+
- name: Build oas
23+
working-directory: .
24+
shell: bash
25+
run: |
26+
make publish-oas
27+
28+
- name: Setup Proxy Name
29+
shell: bash
30+
run: |
31+
32+
if [ -z $PR_NUMBER ]
33+
then
34+
echo "INSTANCE=$PROXYGEN_API_NAME" >> $GITHUB_ENV
35+
else
36+
echo "INSTANCE=$PROXYGEN_API_NAME-$PR_NUMBER" >> $GITHUB_ENV
37+
fi
38+
39+
- name: Install Proxygen client
40+
shell: bash
41+
run: |
42+
# Install proxygen cli in isolated environment with pipx
43+
pip install proxygen-cli
44+
45+
# Setup proxygen auth and settings
46+
mkdir -p ${HOME}/.proxygen
47+
echo -n $PROXYGEN_PRIVATE_KEY | base64 --decode > ${HOME}/.proxygen/key
48+
envsubst < ./.github/proxygen-credentials-template.yaml > ${HOME}/.proxygen/credentials.yaml
49+
envsubst < ./.github/proxygen-credentials-template.yaml | cat
50+
envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml
51+
envsubst < ./.github/proxygen-settings.yaml | cat
52+
53+
- name: Deploy to Internal Dev Sandbox
54+
run: |
55+
proxygen instance deploy internal-dev-sandbox $INSTANCE build/notify-supplier.json --no-confirm
56+
57+
- name: Deploy to Internal Dev
58+
run: |
59+
proxygen instance deploy internal-dev $INSTANCE build/notify-supplier.json --no-confirm
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
client_id: $PROXYGEN_CLIENT_ID
2+
key_id: $PROXYGEN_KID
3+
private_key_path: key
4+
base_url: https://identity.prod.api.platform.nhs.uk/realms/api-producers

.github/proxygen-settings.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
endpoint_url: https://proxygen.prod.api.platform.nhs.uk
2+
api: hello-world

.github/workflows/stage-3-build.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@ jobs:
8181
with:
8282
version: "${{ inputs.version }}"
8383

84+
artefact-proxies:
85+
name: "Build proxies"
86+
runs-on: ubuntu-latest
87+
timeout-minutes: 10
88+
env:
89+
PROXYGEN_PRIVATE_KEY: ${{ secrets.PROXYGEN_NOTIFY_SUPPLIER_PRIVATE_KEY }}
90+
PROXYGEN_KID: notify-supplier-key-1
91+
PROXYGEN_CLIENT_ID: nhs-notify-supplier-client
92+
PROXYGEN_API_NAME: nhs-notify-supplier
93+
PR_NUMBER: ${{ github.event.pull_request.number }}
94+
steps:
95+
- name: "Checkout code"
96+
uses: actions/checkout@v4
97+
- name: "Build proxies"
98+
uses: ./.github/actions/build-proxies
99+
with:
100+
version: "${{ inputs.version }}"
101+
84102
# artefact-1:
85103
# name: "Artefact 1"
86104
# runs-on: ubuntu-latest

0 commit comments

Comments
 (0)