Skip to content

Commit 28c7b6c

Browse files
committed
CCM-12133: move interal-dev deploy to manual workflow
1 parent 831aaa6 commit 28c7b6c

File tree

2 files changed

+94
-25
lines changed

2 files changed

+94
-25
lines changed

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

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
name: "Build Proxies"
22
description: "Build Proxies"
3+
4+
on:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
310
inputs:
411
version:
512
description: "Version number"
613
required: true
14+
715
runs:
816
using: composite
917

@@ -19,7 +27,6 @@ runs:
1927
run: npm ci
2028
shell: bash
2129

22-
2330
- name: Setup Proxy Name and target
2431
shell: bash
2532
run: |
@@ -38,7 +45,6 @@ runs:
3845
3946
fi
4047
41-
4248
- name: Install Proxygen client
4349
shell: bash
4450
run: |
@@ -54,29 +60,6 @@ runs:
5460
envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml
5561
envsubst < ./.github/proxygen-settings.yaml | cat
5662
57-
58-
- name: Build internal dev oas
59-
working-directory: .
60-
shell: bash
61-
run: |
62-
if [ -z $PR_NUMBER ]
63-
then
64-
make build-json-oas-spec APIM_ENV=internal-dev
65-
else
66-
make build-json-oas-spec APIM_ENV=internal-dev-pr
67-
fi
68-
69-
- name: Set target and cert
70-
shell: bash
71-
run: |
72-
jq --arg newurl "$TARGET" '.["x-nhsd-apim"].target.url = $newurl' build/notify-supplier.json > build/notify-supplier_target.json && mv build/notify-supplier_target.json build/notify-supplier.json
73-
jq --arg newmtls "$MTLS_NAME" '.["x-nhsd-apim"].target.security.secret = $newmtls' build/notify-supplier.json > build/notify-supplier_target.json && mv build/notify-supplier_target.json build/notify-supplier.json
74-
75-
- name: Deploy to Internal Dev
76-
shell: bash
77-
run: |
78-
proxygen instance deploy internal-dev $INSTANCE build/notify-supplier.json --no-confirm
79-
8063
- name: Build sandbox oas
8164
working-directory: .
8265
shell: bash
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Deploy proxy to internal-dev
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version number"
8+
required: true
9+
pr_number:
10+
description: "PR Number for PR Environment"
11+
required: false
12+
13+
14+
jobs:
15+
runs-on: ubuntu-latest
16+
deploy-internal-dev:
17+
name: Deploy to Internal Dev
18+
env:
19+
PROXYGEN_API_NAME: notify-supplier-api
20+
PROXYGEN_PRIVATE_KEY: ${{ secrets.PROXYGEN_PRIVATE_KEY }}
21+
PR_NUMBER: ${{ github.event.inputs.pr_number }}
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 24
29+
30+
- name: Npm install
31+
working-directory: .
32+
run: npm ci
33+
shell: bash
34+
35+
- name: Setup Proxy Name and target
36+
shell: bash
37+
run: |
38+
if [ -z $PR_NUMBER ]
39+
then
40+
echo "INSTANCE=$PROXYGEN_API_NAME" >> $GITHUB_ENV
41+
echo "TARGET=https://main.suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
42+
echo "SANDBOX_TAG=latest" >> $GITHUB_ENV
43+
echo "MTLS_NAME=notify-supplier-mtls" >> $GITHUB_ENV
44+
else
45+
echo "TARGET=https://pr$PR_NUMBER.suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
46+
echo "INSTANCE=$PROXYGEN_API_NAME-PR-$PR_NUMBER" >> $GITHUB_ENV
47+
echo "SANDBOX_TAG=pr$PR_NUMBER" >> $GITHUB_ENV
48+
echo "MTLS_NAME=notify-supplier-mtls-pr$PR_NUMBER" >> $GITHUB_ENV
49+
fi
50+
51+
- name: Install Proxygen client
52+
shell: bash
53+
run: |
54+
# Install proxygen cli
55+
pip install pipx
56+
pipx install proxygen-cli
57+
58+
# Setup proxygen auth and settings
59+
mkdir -p ${HOME}/.proxygen
60+
echo -n $PROXYGEN_PRIVATE_KEY | base64 --decode > ${HOME}/.proxygen/key
61+
envsubst < ./.github/proxygen-credentials-template.yaml > ${HOME}/.proxygen/credentials.yaml
62+
envsubst < ./.github/proxygen-credentials-template.yaml | cat
63+
envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml
64+
envsubst < ./.github/proxygen-settings.yaml | cat
65+
66+
- name: Build internal dev oas
67+
working-directory: .
68+
shell: bash
69+
run: |
70+
if [ -z $PR_NUMBER ]
71+
then
72+
make build-json-oas-spec APIM_ENV=internal-dev
73+
else
74+
make build-json-oas-spec APIM_ENV=internal-dev-pr
75+
fi
76+
77+
- name: Set target and cert
78+
shell: bash
79+
run: |
80+
jq --arg newurl "$TARGET" '.["x-nhsd-apim"].target.url = $newurl' build/notify-supplier.json > build/notify-supplier_target.json && mv build/notify-supplier_target.json build/notify-supplier.json
81+
jq --arg newmtls "$MTLS_NAME" '.["x-nhsd-apim"].target.security.secret = $newmtls' build/notify-supplier.json > build/notify-supplier_target.json && mv build/notify-supplier_target.json build/notify-supplier.json
82+
83+
- name: Deploy to Internal Dev
84+
shell: bash
85+
run: |
86+
proxygen instance deploy internal-dev $INSTANCE build/notify-supplier.json --no-confirm

0 commit comments

Comments
 (0)