-
Notifications
You must be signed in to change notification settings - Fork 4
127 lines (111 loc) · 4.2 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
name: Deploy @fern-ui/docs-bundle
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 }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install
- name: Build & Deploy to Vercel
id: deploy
run: |
pnpm vercel-scripts deploy app.buildwithfern.com --token=${{ secrets.VERCEL_TOKEN }} --environment=production
echo "deployment_url=$(cat deployment-url.txt)" >> $GITHUB_OUTPUT
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 }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install
- name: Build & Deploy to Vercel
id: deploy
run: |
pnpm vercel-scripts deploy app.ferndocs.com --token=${{ secrets.VERCEL_TOKEN }} --environment=production
echo "deployment_url=$(cat deployment-url.txt)" >> $GITHUB_OUTPUT
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 }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install
- name: Build & Deploy to Vercel
id: deploy
run: |
pnpm vercel-scripts deploy app-slash.ferndocs.com --token=${{ secrets.VERCEL_TOKEN }} --environment=production
echo "deployment_url=$(cat deployment-url.txt)" >> $GITHUB_OUTPUT
ete:
needs: deploy_app_buildwithfern_com
if: needs.deploy_app_buildwithfern_com.outputs.deployment_url
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/ete-docs-bundle
with:
deployment_url: ${{ needs.deploy_app_buildwithfern_com.outputs.deployment_url }}
token: ${{ secrets.VERCEL_TOKEN }}
fern_token: ${{ secrets.FERN_TOKEN }}
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
- uses: ./.github/actions/install
- name: Promote Deployment
run: pnpm vercel-scripts promote ${{ matrix.deployment_url }} --token ${{ secrets.VERCEL_TOKEN }}
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