-
Notifications
You must be signed in to change notification settings - Fork 29
143 lines (125 loc) · 4.51 KB
/
deploy-docs.yaml
File metadata and controls
143 lines (125 loc) · 4.51 KB
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
name: Deploy Docs
# Deploys the docs app to Vercel production when a docs-vX.X.X tag is pushed
# This workflow is triggered by tags matching the pattern docs-v*.*.*
permissions:
actions: write
contents: read
deployments: write
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_DOCS_PROJECT_ID: ${{ secrets.VERCEL_DOCS_PROJECT_ID }}
VERCEL_STORYBOOK_PROJECT_ID: ${{ secrets.VERCEL_STORYBOOK_PROJECT_ID }}
on:
push:
tags:
- 'docs-v*.*.*'
concurrency:
group: deploy-docs-${{ github.ref }}
cancel-in-progress: false
jobs:
parse-docs-tag:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract-version.outputs.version }}
steps:
- name: Extract version from tag
id: extract-version
run: |
# Extract version from docs-vX.X.X format (e.g., docs-v1.2.3 -> 1.2.3)
TAG="${GITHUB_REF#refs/tags/}"
VERSION="${TAG#docs-v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Deploying docs version: $VERSION"
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
# Minimal checkout just to make the action file available
fetch-depth: 1
- name: Build
uses: ./.github/actions/build
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: '0'
lint:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
# Minimal checkout just to make the action file available
fetch-depth: 1
- name: Lint
uses: ./.github/actions/lint
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: '0'
test:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
# Minimal checkout just to make the action file available
fetch-depth: 1
- name: Test
uses: ./.github/actions/test
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: '0'
deploy-docs:
runs-on: ubuntu-latest
needs: [parse-docs-tag, build, lint, test]
environment:
name: docs-production
url: ${{ steps.deploy-docs.outputs.deployment-url }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Prepare Environment
uses: ./.github/actions/setup-env
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy Docs to Vercel
id: deploy-docs
uses: ./.github/actions/deploy-vercel
timeout-minutes: 20
with:
vercel-token: ${{ secrets.VERCEL_ACCESS_TOKEN }}
vercel-org-id: ${{ env.VERCEL_ORG_ID }}
vercel-project-id: ${{ env.VERCEL_DOCS_PROJECT_ID }}
environment: production
build-args: '--prod'
deploy-args: '--prod'
deploy-storybook:
runs-on: ubuntu-latest
needs: [parse-docs-tag, build, lint, test]
environment:
name: storybook-production
url: ${{ steps.deploy-storybook.outputs.deployment-url }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Prepare Environment
uses: ./.github/actions/setup-env
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy Storybook to Vercel
id: deploy-storybook
uses: ./.github/actions/deploy-vercel
timeout-minutes: 20
with:
vercel-token: ${{ secrets.VERCEL_ACCESS_TOKEN }}
vercel-org-id: ${{ env.VERCEL_ORG_ID }}
vercel-project-id: ${{ env.VERCEL_STORYBOOK_PROJECT_ID }}
environment: production
build-args: '--prod'
deploy-args: '--prod'