Skip to content

Commit 054ce85

Browse files
committed
eli-338 adding github action to publish specification
1 parent 47bdc50 commit 054ce85

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish specification
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: 'Environment to deploy to'
8+
required: true
9+
default: 'preprod'
10+
type: choice
11+
options:
12+
- preprod
13+
- prod
14+
15+
env:
16+
APIM_ENV: ${{ github.event.inputs.environment || 'preprod' }}
17+
18+
jobs:
19+
deploy-sandbox:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v5
25+
26+
- name: Set up Python 3.11
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.11'
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '20'
35+
36+
- name: Install Poetry
37+
run: curl -sSL https://install.python-poetry.org | python3 -
38+
39+
- name: Install Python and Node dependencies
40+
run: |
41+
make install
42+
43+
- name: Install proxygen-cli
44+
run: |
45+
pip install proxygen-cli
46+
47+
- name: Set up Proxygen credentials
48+
env:
49+
PROXYGEN_PRIVATE_KEY: ${{ secrets.PROXYGEN_PRIVATE_KEY }}
50+
run: |
51+
mkdir -p ~/.proxygen
52+
echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api.pem
53+
make setup-proxygen-credentials
54+
55+
- name: Generate specification
56+
run: |
57+
make construct-spec APIM_ENV=${{ env.APIM_ENV }}
58+
59+
- name: Publish ${{ env.APIM_ENV }} spec to Proxygen
60+
run: |
61+
if [ "${{ env.APIM_ENV }}" = "preprod" ]; then
62+
proxygen spec publish build/specification/preprod/eligibility-signposting-api.yaml --uat
63+
else
64+
proxygen spec publish build/specification/prod/eligibility-signposting-api.yaml
65+
fi
66+

0 commit comments

Comments
 (0)