@@ -3,14 +3,13 @@ name: Deploy proxy to internal-dev
33on :
44 workflow_dispatch :
55 inputs :
6- pr_number :
7- description : " PR Number for PR Environment"
8- required : false
6+ pr_number :
7+ description : " PR Number for PR Environment"
8+ required : false
99
1010permissions :
1111 contents : read
1212
13-
1413jobs :
1514 deploy-internal-dev :
1615 runs-on : ubuntu-latest
@@ -19,69 +18,68 @@ jobs:
1918 PROXYGEN_API_NAME : notify-supplier-api
2019 PROXYGEN_PRIVATE_KEY : ${{ secrets.PROXYGEN_PRIVATE_KEY }}
2120 PR_NUMBER : ${{ github.event.inputs.pr_number }}
21+ steps :
22+ - name : Checkout
23+ uses : actions/checkout@v4
2224
23- steps :
24- - name : Checkout
25- uses : actions/checkout@v4
26-
27- - uses : actions/setup-node@v4
28- with :
29- node-version : 24
25+ - uses : actions/setup-node@v4
26+ with :
27+ node-version : 24
3028
31- - name : Npm install
32- working-directory : .
33- run : npm ci
34- shell : bash
29+ - name : Npm install
30+ working-directory : .
31+ run : npm ci
32+ shell : bash
3533
36- - name : Setup Proxy Name and target
37- shell : bash
38- run : |
39- if [ -z $PR_NUMBER ]
40- then
41- echo "INSTANCE=$PROXYGEN_API_NAME" >> $GITHUB_ENV
42- echo "TARGET=https://main.suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
43- echo "SANDBOX_TAG=latest" >> $GITHUB_ENV
44- echo "MTLS_NAME=notify-supplier-mtls" >> $GITHUB_ENV
45- else
46- echo "TARGET=https://pr$PR_NUMBER.suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
47- echo "INSTANCE=$PROXYGEN_API_NAME-PR-$PR_NUMBER" >> $GITHUB_ENV
48- echo "SANDBOX_TAG=pr$PR_NUMBER" >> $GITHUB_ENV
49- echo "MTLS_NAME=notify-supplier-mtls-pr$PR_NUMBER" >> $GITHUB_ENV
50- fi
34+ - name : Setup Proxy Name and target
35+ shell : bash
36+ run : |
37+ if [ -z $PR_NUMBER ]
38+ then
39+ echo "INSTANCE=$PROXYGEN_API_NAME" >> $GITHUB_ENV
40+ echo "TARGET=https://main.suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
41+ echo "SANDBOX_TAG=latest" >> $GITHUB_ENV
42+ echo "MTLS_NAME=notify-supplier-mtls" >> $GITHUB_ENV
43+ else
44+ echo "TARGET=https://pr$PR_NUMBER.suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
45+ echo "INSTANCE=$PROXYGEN_API_NAME-PR-$PR_NUMBER" >> $GITHUB_ENV
46+ echo "SANDBOX_TAG=pr$PR_NUMBER" >> $GITHUB_ENV
47+ echo "MTLS_NAME=notify-supplier-mtls-pr$PR_NUMBER" >> $GITHUB_ENV
48+ fi
5149
52- - name : Install Proxygen client
53- shell : bash
54- run : |
55- # Install proxygen cli
56- pip install pipx
57- pipx install proxygen-cli
50+ - name : Install Proxygen client
51+ shell : bash
52+ run : |
53+ # Install proxygen cli
54+ pip install pipx
55+ pipx install proxygen-cli
5856
59- # Setup proxygen auth and settings
60- mkdir -p ${HOME}/.proxygen
61- echo -n $PROXYGEN_PRIVATE_KEY | base64 --decode > ${HOME}/.proxygen/key
62- envsubst < ./.github/proxygen-credentials-template.yaml > ${HOME}/.proxygen/credentials.yaml
63- envsubst < ./.github/proxygen-credentials-template.yaml | cat
64- envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml
65- envsubst < ./.github/proxygen-settings.yaml | cat
57+ # Setup proxygen auth and settings
58+ mkdir -p ${HOME}/.proxygen
59+ echo -n $PROXYGEN_PRIVATE_KEY | base64 --decode > ${HOME}/.proxygen/key
60+ envsubst < ./.github/proxygen-credentials-template.yaml > ${HOME}/.proxygen/credentials.yaml
61+ envsubst < ./.github/proxygen-credentials-template.yaml | cat
62+ envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml
63+ envsubst < ./.github/proxygen-settings.yaml | cat
6664
67- - name : Build internal dev oas
68- working-directory : .
69- shell : bash
70- run : |
71- if [ -z $PR_NUMBER ]
72- then
73- make build-json-oas-spec APIM_ENV=internal-dev
74- else
75- make build-json-oas-spec APIM_ENV=internal-dev-pr
76- fi
65+ - name : Build internal dev oas
66+ working-directory : .
67+ shell : bash
68+ run : |
69+ if [ -z $PR_NUMBER ]
70+ then
71+ make build-json-oas-spec APIM_ENV=internal-dev
72+ else
73+ make build-json-oas-spec APIM_ENV=internal-dev-pr
74+ fi
7775
78- - name : Set target and cert
79- shell : bash
80- run : |
81- 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
82- 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
76+ - name : Set target and cert
77+ shell : bash
78+ run : |
79+ 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
80+ 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
8381
84- - name : Deploy to Internal Dev
85- shell : bash
86- run : |
87- proxygen instance deploy internal-dev $INSTANCE build/notify-supplier.json --no-confirm
82+ - name : Deploy to Internal Dev
83+ shell : bash
84+ run : |
85+ proxygen instance deploy internal-dev $INSTANCE build/notify-supplier.json --no-confirm
0 commit comments