-
Notifications
You must be signed in to change notification settings - Fork 4
147 lines (132 loc) · 4.5 KB
/
deploy-docs-bundle-prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Deploy @fern-ui/docs-bundle
env:
VERCEL_ORG_ID: team_6FKOM5nw037hv8g2mTk3gaH7
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: "buildwithfern"
on:
push:
tags:
- ui@*
concurrency:
group: app.buildwithfern.com
cancel-in-progress: true
jobs:
deploy_app_buildwithfern_com:
runs-on: ubuntu-latest
if: github.ref_type == 'tag' && github.event_name == 'push'
environment:
name: Production - app.buildwithfern.com
url: ${{ steps.deploy.outputs.deployment_url }}
outputs:
deployment_url: ${{ steps.deploy.outputs.deployment_url }}
env:
VERCEL_PROJECT_ID: prj_QX3venU6jwRUmdt8ArfL8AU5r1d4
steps:
- uses: actions/checkout@v4
- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
id: deploy
with:
package: "@fern-ui/docs-bundle"
environment: production
force: true
deploy_app_ferndocs_com:
runs-on: ubuntu-latest
if: github.ref_type == 'tag' && github.event_name == 'push'
environment:
name: Production - app.ferndocs.com
url: ${{ steps.deploy.outputs.deployment_url }}
outputs:
deployment_url: ${{ steps.deploy.outputs.deployment_url }}
env:
VERCEL_PROJECT_ID: prj_SfgTTzw7KefTMuVWsL5uhY8Y4BIt
steps:
- uses: actions/checkout@v4
- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
id: deploy
with:
package: "@fern-ui/docs-bundle"
environment: production
force: true
deploy_app-slash_ferndocs_com:
runs-on: ubuntu-latest
if: github.ref_type == 'tag' && github.event_name == 'push'
environment:
name: Production - app-slash.ferndocs.com
url: ${{ steps.deploy.outputs.deployment_url }}
outputs:
deployment_url: ${{ steps.deploy.outputs.deployment_url }}
env:
VERCEL_PROJECT_ID: prj_GGc6CEzrWNyUK0hq1UK7KmbgUmZn
steps:
- uses: actions/checkout@v4
- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
id: deploy
with:
package: "@fern-ui/docs-bundle"
environment: production
force: true
ete:
needs: deploy_app_buildwithfern_com
if: needs.deploy_app_buildwithfern_com.outputs.deployment_url
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# this script generates domains.txt and preview.txt
- name: Fetch domains
run: node scripts/fetch-domains.js
- uses: ./github/actions/ete-docs-bundle
with:
deployment_url: ${{ needs.deploy_app_buildwithfern_com.outputs.deployment_url }}
promote:
needs:
- deploy_app_buildwithfern_com
- deploy_app_ferndocs_com
- deploy_app-slash_ferndocs_com
- ete # Ensure that the E2E tests are run successful before promoting
runs-on: ubuntu-latest
strategy:
matrix:
deployment_url:
- ${{ needs.deploy_app_buildwithfern_com.outputs.deployment_url }}
- ${{ needs.deploy_app_ferndocs_com.outputs.deployment_url }}
- ${{ needs.deploy_app-slash_ferndocs_com.outputs.deployment_url }}
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install -g vercel
- name: Promote Deployment
run: vercel promote ${{ matrix.deployment_url }} --token $VERCEL_TOKEN
revalidate-all:
needs: promote # Ensure that the deployment is promoted before revalidating
uses: ./.github/workflows/revalidate-all.yml
with:
deployment_url: https://app.buildwithfern.com
smoke-test:
needs: promote # Ensure that the deployment is promoted before running smoke tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Smoke Test
env:
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
run: |
cd smoke-test
npm install -g fern-api
fern generate --docs --instance https://fern-platform-test.docs.buildwithfern.com
VALUE=$(curl https://fern-platform-test.docs.buildwithfern.com/api-reference/imdb/create-movie)
length=${#VALUE}
# Assert that length is over 1000
if [ $length -gt 1000 ]; then
echo "Length is greater than 1000"
else
exit 1
fi
healthchecks:
needs: promote # Ensure that the deployment is promoted before running healthchecks
uses: ./.github/workflows/healthcheck.yml
secrets: inherit