File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9797 payload : |
9898 status: "${{ job.status }}"
9999 link: "https://github.com/${{ github.repository }}/commit/${{ github.sha }}"
100- author : "${{ github.actor }}"
101- title : "Pushed to main "
100+ triggered_by : "${{ github.actor }}"
101+ environment : "Specification updated in Dev & Sandbox "
102102 version: "${{ needs.metadata.outputs.version }}"
Original file line number Diff line number Diff line change @@ -2,12 +2,31 @@ name: Deploy to Preprod
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ ref :
7+ description : " Tag to promote (e.g. spec-{timestamp})"
8+ default : latest
9+ required : true
510
611jobs :
712 preprod :
813 runs-on : ubuntu-latest
914 steps :
1015 - uses : actions/checkout@v6
16+ - name : Set tag to deploy
17+ id : set_tag
18+ run : |
19+ if [ "${{ github.event.inputs.ref }}" = "latest" ]; then
20+ TAG=$(git tag --list 'spec-*' --sort=-v:refname | head -n 1)
21+ echo "Using latest tag: $TAG"
22+ echo "tag=$TAG" >> $GITHUB_OUTPUT
23+ else
24+ echo "tag=${{ github.event.inputs.ref }}" >> $GITHUB_OUTPUT
25+ fi
26+ - name : Checkout tag
27+ uses : actions/checkout@v6
28+ with :
29+ ref : ${{ steps.set_tag.outputs.tag }}
1130 - uses : actions/setup-python@v6
1231 with :
1332 python-version : ' 3.11'
Original file line number Diff line number Diff line change @@ -2,12 +2,20 @@ name: Deploy to Prod
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ ref :
7+ description : " Tag to promote (e.g. spec-{timestamp})"
8+ required : true
59
610jobs :
711 prod :
812 runs-on : ubuntu-latest
913 steps :
1014 - uses : actions/checkout@v6
15+ - name : Checkout tag
16+ uses : actions/checkout@v6
17+ with :
18+ ref : ${{ inputs.ref }}
1119 - uses : actions/setup-python@v6
1220 with :
1321 python-version : ' 3.11'
1826 - run : make construct-spec APIM_ENV=prod
1927 - run : make publish-spec APIM_ENV=prod
2028 - run : make deploy-spec APIM_ENV=prod
29+
30+ create_release :
31+ needs : prod
32+ runs-on : ubuntu-latest
33+ steps :
34+ - name : Create GitHub Release
35+ uses : actions/create-release@v1
36+ env :
37+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
38+ with :
39+ tag_name : ${{ inputs.ref }}
40+ release_name : Release ${{ inputs.ref }}
41+ draft : false
42+ prerelease : false
You can’t perform that action at this time.
0 commit comments