Skip to content

Commit 5b5acc6

Browse files
committed
ELI-338: fixes setup for preprod and prod
1 parent 2b2c456 commit 5b5acc6

3 files changed

Lines changed: 69 additions & 16 deletions

File tree

.github/workflows/dev_sandbox_publish_deploy.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
- ELI-338
87

98
jobs:
109
metadata:

.github/workflows/preprod_publish_deploy.yaml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
preprod:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v6
1615
- name: Set tag to deploy
1716
id: set_tag
1817
run: |
@@ -27,13 +26,35 @@ jobs:
2726
uses: actions/checkout@v6
2827
with:
2928
ref: ${{ steps.set_tag.outputs.tag }}
30-
- uses: actions/setup-python@v6
29+
- name: Set up Python 3.11
30+
uses: actions/setup-python@v6
3131
with:
3232
python-version: '3.11'
33-
- uses: actions/setup-node@v6
33+
- name: Set up Node.js
34+
uses: actions/setup-node@v6
3435
with:
3536
node-version: '20'
36-
- run: make install
37-
- run: make construct-spec APIM_ENV=preprod
38-
- run: make publish-spec APIM_ENV=preprod
39-
- run: make deploy-spec APIM_ENV=preprod
37+
- name: Install Poetry
38+
run: curl -sSL https://install.python-poetry.org | python3 -
39+
- name: Install Python and Node dependencies
40+
run: |
41+
make install
42+
- name: Install proxygen-cli
43+
run: |
44+
pip install proxygen-cli
45+
- name: Set up Proxygen credentials
46+
env:
47+
PROXYGEN_PRIVATE_KEY: ${{ secrets.PROXYGEN_PRIVATE_KEY }}
48+
run: |
49+
mkdir -p ~/.proxygen
50+
echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api.pem
51+
make setup-proxygen-credentials
52+
- name: Generate specification
53+
run: |
54+
make construct-spec APIM_ENV=preprod
55+
- name: Publish preprod spec to Proxygen
56+
run: |
57+
proxygen spec publish build/specification/preprod/eligibility-signposting-api.yaml --uat --no-confirm
58+
- name: Deploy preprod spec to Proxygen
59+
run: |
60+
proxygen instance deploy preprod eligibility-signposting-api build/specification/preprod/eligibility-signposting-api.yaml --no-confirm

.github/workflows/prod_publish_deploy.yaml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,52 @@ jobs:
1111
prod:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v6
14+
- name: Set tag to deploy
15+
id: set_tag
16+
run: |
17+
if [ "${{ github.event.inputs.ref }}" = "latest" ]; then
18+
TAG=$(git tag --list 'spec-*' --sort=-v:refname | head -n 1)
19+
echo "Using latest tag: $TAG"
20+
echo "tag=$TAG" >> $GITHUB_OUTPUT
21+
else
22+
echo "tag=${{ github.event.inputs.ref }}" >> $GITHUB_OUTPUT
23+
fi
1524
- name: Checkout tag
1625
uses: actions/checkout@v6
1726
with:
18-
ref: ${{ inputs.ref }}
19-
- uses: actions/setup-python@v6
27+
ref: ${{ steps.set_tag.outputs.tag }}
28+
- name: Set up Python 3.11
29+
uses: actions/setup-python@v6
2030
with:
2131
python-version: '3.11'
22-
- uses: actions/setup-node@v6
32+
- name: Set up Node.js
33+
uses: actions/setup-node@v6
2334
with:
2435
node-version: '20'
25-
- run: make install
26-
- run: make construct-spec APIM_ENV=prod
27-
- run: make publish-spec APIM_ENV=prod
28-
- run: make deploy-spec APIM_ENV=prod
36+
- name: Install Poetry
37+
run: curl -sSL https://install.python-poetry.org | python3 -
38+
- name: Install Python and Node dependencies
39+
run: |
40+
make install
41+
- name: Install proxygen-cli
42+
run: |
43+
pip install proxygen-cli
44+
- name: Set up Proxygen credentials
45+
env:
46+
PROXYGEN_PRIVATE_KEY: ${{ secrets.PROXYGEN_PRIVATE_KEY }}
47+
run: |
48+
mkdir -p ~/.proxygen
49+
echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api.pem
50+
make setup-proxygen-credentials
51+
- name: Generate specification
52+
run: |
53+
make construct-spec APIM_ENV=prod
54+
- name: Publish prod spec to Proxygen
55+
run: |
56+
proxygen spec publish build/specification/prod/eligibility-signposting-api.yaml --no-confirm
57+
- name: Deploy prod spec to Proxygen
58+
run: |
59+
proxygen instance deploy prod eligibility-signposting-api build/specification/prod/eligibility-signposting-api.yaml --no-confirm
2960
3061
create_release:
3162
needs: prod
@@ -38,5 +69,7 @@ jobs:
3869
with:
3970
tag_name: ${{ inputs.ref }}
4071
release_name: Release ${{ inputs.ref }}
72+
body: |
73+
Auto-release created during production deployment.
4174
draft: false
4275
prerelease: false

0 commit comments

Comments
 (0)