11name : Promote staging to PROD
22on :
3+ pull_request :
4+ paths :
5+ - .github/workflows/prod-deploy.yml # For testing changes, won't deploy to prod
36 release :
47 types :
58 - released
@@ -14,31 +17,53 @@ concurrency:
1417 cancel-in-progress : false
1518
1619jobs :
17- deploy-app :
18- name : app-prod-deploy
20+ get-release-artifacts :
21+ name : download-${{ matrix.artifact.name }}
22+ runs-on : ubuntu-latest
1923 permissions :
2024 contents : ' read'
2125 id-token : ' write'
22- runs-on : ubuntu-latest
23- environment : production
26+ strategy :
27+ matrix :
28+ artifact :
29+ - name : webpack
30+ path : centrifuge-app/build/
31+ - name : pinning-api
32+ path : pinning-api/dist/
33+ - name : onboarding-api
34+ path : onboarding-api/dist/
2435 steps :
2536 - uses : dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # v1.1.2
2637 with :
2738 repo : ' centrifuge/apps'
2839 version : ${{ github.event_name == 'release' && github.event.release.id || format('tags/centrifuge-app/{0}', inputs.tag) }}
29- file : " webpack.zip"
30- regex : true
40+ # version: 'tags/centrifuge-app/v2.83.4' # <- uncomment thisfor testing
41+ file : " ${{ matrix.artifact.name }}.zip"
42+ target : " ${{ matrix.artifact.name }}.zip"
3143
3244 - name : Unzip release files
45+ env :
46+ ZIPFILE : ${{ matrix.artifact.name }}
3347 run : |
34- unzip webpack.zip -d webpack 1> /dev/null
35- # Unzipped folder structure is webpack/centrifuge-app/build/inde.js
48+ ls -la
49+ unzip $ZIPFILE 1> /dev/null
50+ ls -la
3651
3752 - name : Upload webpack files
3853 uses : actions/upload-artifact@v4
3954 with :
40- name : webpack
41- path : webpack/centrifuge-app/build/
55+ name : ${{ matrix.artifact.name }}
56+ path : ${{ matrix.artifact.path }}
57+
58+ deploy-app :
59+ name : app-prod-deploy
60+ permissions :
61+ contents : ' read'
62+ id-token : ' write'
63+ runs-on : ubuntu-latest
64+ environment : production
65+ if : ${{ github.event_name != 'pull_request' }}
66+ steps :
4267
4368 - name : Checkout
4469 uses : actions/checkout@v4
6085 name : ${{ matrix.function.name }}-prod-deploy
6186 runs-on : ubuntu-latest
6287 environment : production
88+ if : ${{ github.event_name != 'pull_request' }}
6389 permissions :
6490 contents : ' read'
6591 id-token : ' write'
@@ -75,24 +101,6 @@ jobs:
75101 service_account : ${{ vars.ONBOARDING_FUNCT_SA }}
76102 steps :
77103
78- - uses : dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # v1.1.2
79- with :
80- repo : ' centrifuge/apps'
81- version : ${{ github.event_name == 'release' && github.event.release.id || format('tags/centrifuge-app/{0}', inputs.tag) }}
82- file : " ${{ matrix.function.name }}.zip"
83- regex : true
84-
85- - name : Unzip release files
86- run : |
87- unzip ${{ matrix.function.name }}.zip 1> /dev/null
88- # Unzipped folder structure is ${{ matrix.function.name }}/dist/index.js
89-
90- - name : Upload function files
91- uses : actions/upload-artifact@v4
92- with :
93- name : ${{ matrix.function.name }}
94- path : ${{ matrix.function.name }}/dist/
95-
96104 - name : Checkout
97105 uses : actions/checkout@v4
98106 with :
0 commit comments