@@ -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
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