Skip to content

Commit 6f46efb

Browse files
Sandbox workflow
1 parent 9480ad3 commit 6f46efb

File tree

3 files changed

+72
-9
lines changed

3 files changed

+72
-9
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 sandbox oas
23+
working-directory: .
24+
shell: bash
25+
run: |
26+
make construct-spec APIM_ENV=sandbox
27+
28+
29+
- name: Install Proxygen client
30+
shell: bash
31+
run: |
32+
# Install proxygen cli
33+
pip install pipx
34+
pipx install proxygen-cli
35+
36+
# Setup proxygen auth and settings
37+
mkdir -p ${HOME}/.proxygen
38+
echo -n $PROXYGEN_PRIVATE_KEY | base64 --decode > ${HOME}/.proxygen/key
39+
envsubst < ./.github/proxygen-credentials-template.yaml > ${HOME}/.proxygen/credentials.yaml
40+
envsubst < ./.github/proxygen-credentials-template.yaml | cat
41+
envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml
42+
envsubst < ./.github/proxygen-settings.yaml | cat
43+
44+
- name: Build and publish sandbox Docker image
45+
shell: bash
46+
working-directory: ./sandbox
47+
run: |
48+
docker build -t nhs-notify-supplier:latest .
49+
proxygen docker get-login | bash
50+
docker build -t nhs-notify-supplier:latest .
51+
IMAGE_ID=`docker images -q nhs-notify-supplier:latest`
52+
docker tag $(IMAGE_ID) 958002497996.dkr.ecr.eu-west-2.amazonaws.com/nhs-notify-supplier:latest
53+
docker push 958002497996.dkr.ecr.eu-west-2.amazonaws.com/nhs-notify-supplier:latest

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,31 @@ jobs:
9696
PROXYGEN_API_NAME: nhs-notify-supplier
9797
PR_NUMBER: ${{ inputs.pr_number }}
9898
steps:
99-
- name: Verify environment variables
100-
shell: bash
101-
run: |
102-
echo "PROXYGEN_PRIVATE_KEY is set: [${{ secrets.PROXYGEN_ENCODED_NOTIFY_SUPPLIER_PRIVATE_KEY != '' }}]"
103-
echo "PROXYGEN_KID: $PROXYGEN_KID"
104-
echo "PROXYGEN_CLIENT_ID: $PROXYGEN_CLIENT_ID"
105-
echo "PROXYGEN_API_NAME: $PROXYGEN_API_NAME"
106-
echo "PR_NUMBER: $PR_NUMBER"
10799
- name: "Checkout code"
108100
uses: actions/checkout@v4
109101
- name: "Build proxies"
110102
uses: ./.github/actions/build-proxies
111103
with:
112104
version: "${{ inputs.version }}"
113105

106+
artefact-sandbox:
107+
name: "Build sandbox"
108+
runs-on: ubuntu-latest
109+
timeout-minutes: 10
110+
env:
111+
PROXYGEN_PRIVATE_KEY: ${{ secrets.PROXYGEN_ENCODED_NOTIFY_SUPPLIER_PRIVATE_KEY }}
112+
PROXYGEN_KID: notify-supplier-key-1
113+
PROXYGEN_CLIENT_ID: nhs-notify-supplier-client
114+
PROXYGEN_API_NAME: nhs-notify-supplier
115+
PR_NUMBER: ${{ inputs.pr_number }}
116+
steps:
117+
- name: "Checkout code"
118+
uses: actions/checkout@v4
119+
- name: "Build sandbox"
120+
uses: ./.github/actions/build-sandbox
121+
with:
122+
version: "${{ inputs.version }}"
123+
114124
# artefact-1:
115125
# name: "Artefact 1"
116126
# runs-on: ubuntu-latest

sandbox/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM node:18.3.0-alpine3.14
22

3-
ENV npm_config_cache=/home/node/app/.npm
3+
ENV npm_config_cache=.npm
44

55
COPY . /sandbox
66

0 commit comments

Comments
 (0)