Skip to content

Commit b2fe3e4

Browse files
committed
ci: Test and fix prod deploy (#2640)
* Test and fix prod deploy * Remove useless Readme * Update readme with new workflow files
1 parent d7470ab commit b2fe3e4

3 files changed

Lines changed: 45 additions & 82 deletions

File tree

.github/workflows/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@ Each workflow represents a different trigger rather than a different "way of bui
77
```
88
.github/workflows
99
├── centrifuge-app.yml -> triggers on PR or push to main (only changes to centrifuge-app components)
10+
├── centrifuge-app-countercheck.yml -> validates centrifuge-app deployment
1011
├── demo-deploys.yml -> manual triggered deployment (deploys all)
12+
├── dev-n-ffprod-deploys.yml -> handles development and feature-flag production deployments
13+
├── deploy_all.yml -> orchestrates deployment of all components
14+
├── e2e.yml -> runs end-to-end tests
1115
├── fabric.yml -> builds on PR or push to main (only changes to fabric/)
12-
├── faucet-api.yml. Deploys
16+
├── faucet-api.yml -> handles faucet API deployments
1317
├── npm-publish.yml -> always manual from main
1418
├── onboarding-api.yml -> triggers on PR or push to main (only changes to onboarding-api/)
19+
├── onboarding-api-countercheck.yml -> validates onboarding-api deployment
1520
├── pinning-api.yml -> triggers on PR or push to main (only changes to pinning-api/)
16-
├── pre-prod-deploys.yml -> Manually deploy from main to Altair & Pre-prod. Always manual. Requires approval
21+
├── pinning-api-countercheck.yml -> validates pinning-api deployment
1722
├── prepare-pr.yml -> Deploy functions for all PRs. Delete PR artifacts when closed
18-
└── prod-deploys.yml -> Move artifacts from pre-prod. Always manual. Requires approval
23+
├── prod-deploy.yml -> Fetches artifacts form an existing release
24+
└── staging-deploy.yml -> Builds & Uploads artifacts to a release, then deploys to staging and ff-prod
1925
```
2026
### Supporting actions
2127
```

.github/workflows/prod-deploy.yml

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Promote staging to PROD
22
on:
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

1619
jobs:
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
@@ -60,6 +85,7 @@ jobs:
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:

centrifuge-app/README.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)