forked from vuepress-theme-hope/vuepress-theme-hope
-
Notifications
You must be signed in to change notification settings - Fork 0
335 lines (290 loc) · 9.73 KB
/
deploy-production.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
name: Deploy Production Docs and Demos
on:
workflow_call:
secrets:
ACCESS_TOKEN:
required: true
jobs:
deploy-netlify-docs:
name: Deploy V2 docs to Netlify
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Restore Build Result
uses: actions/download-artifact@v4
with:
name: build-result
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Docs build
env:
NETLIFY: true
NODE_OPTIONS: --max_old_space_size=8192
run: pnpm run docs:vite-build
- name: Deploy append-date docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/append-date-docs
branch: netlify
folder: docs/append-date/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy auto-catalog docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/auto-catalog-docs
branch: netlify
folder: docs/auto-catalog/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy blog2 docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/blog2-docs
branch: netlify
folder: docs/blog2/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy comment2 docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/comment2-docs
branch: netlify
folder: docs/comment2/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy components docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/components-docs
branch: netlify
folder: docs/components/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy lightgallery docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/lightgallery-docs
branch: netlify
folder: docs/lightgallery/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy md-enhance docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/md-enhance-docs
branch: netlify
folder: docs/md-enhance/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy photo-swipe docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/photo-swipe-docs
branch: netlify
folder: docs/photo-swipe/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy pwa2 docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/pwa2-docs
branch: netlify
folder: docs/pwa2/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy sass-palette docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/sass-palette-docs
branch: netlify
folder: docs/sass-palette/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy search-pro docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/search-pro-docs
branch: netlify
folder: docs/search-pro/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy shared docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/shared-docs
branch: netlify
folder: docs/shared/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Deploy theme docs
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/v2-theme-docs
branch: netlify
folder: docs/theme/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
deploy-gitee-docs:
name: Deploy V2 docs to Gitee
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Restore Build Result
uses: actions/download-artifact@v4
with:
name: build-result
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Docs build
env:
GITEE: true
NODE_OPTIONS: --max_old_space_size=8192
run: pnpm run docs:vite-build
- name: Combine output
run: |
pnpm cpx "docs/append-date/dist/**" dist/auto-catalog
pnpm cpx "docs/auto-catalog/dist/**" dist/auto-catalog
pnpm cpx "docs/blog2/dist/**" dist/blog
pnpm cpx "docs/comment2/dist/**" dist/comment
pnpm cpx "docs/components/dist/**" dist/components
pnpm cpx "docs/lightgallery/dist/**" dist/lightgallery
pnpm cpx "docs/md-enhance/dist/**" dist/md-enhance
pnpm cpx "docs/photo-swipe/dist/**" dist/photo-swipe
pnpm cpx "docs/pwa2/dist/**" dist/pwa
pnpm cpx "docs/sass-palette/dist/**" dist/sass-palette
pnpm cpx "docs/search-pro/dist/**" dist/search-pro
pnpm cpx "docs/shared/dist/**" dist/shared
pnpm cpx "docs/theme/dist/**" dist
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/v2
branch: gitee
folder: dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
deploy-theme-demo:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name:
- blog
- docs
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore Build Result
uses: actions/download-artifact@v4
with:
name: build-result
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Build Netlify Demo
env:
NODE_OPTIONS: --max_old_space_size=8192
run: |-
pnpm --filter theme-${{ matrix.name }}-demo demo:vite-build
> demo/theme-${{ matrix.name }}/dist/.nojekyll
- name: Deploy to netlify
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/${{ matrix.name }}-demo
branch: netlify
folder: demo/theme-${{ matrix.name }}/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
- name: Build Gitee Demo
env:
BASE: /${{ matrix.name }}-demo/
HOSTNAME: https://vuepress-theme-hope.gitee.io/
NODE_OPTIONS: --max_old_space_size=8192
run: |-
pnpm --filter theme-${{ matrix.name }}-demo demo:vite-build
> demo/theme-${{ matrix.name }}/dist/.nojekyll
- name: Deploy to gitee
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/${{ matrix.name }}-demo
branch: gitee
folder: demo/theme-${{ matrix.name }}/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true
deploy-plugin-demo:
name: Deploy ${{ matrix.plugin-name }} demo
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
plugin-name:
- auto-catalog
- blog2
- comment2
- components
- lightgallery
- md-enhance
- photo-swipe
- pwa2
- sass-palette
- search-pro
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Restore Build Result
uses: actions/download-artifact@v4
with:
name: build-result
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Build ${{ matrix.plugin-name }} demo
env:
NODE_OPTIONS: --max_old_space_size=8192
run: |-
pnpm --filter ${{ matrix.plugin-name }}-demo demo:vite-build
- name: Deploy ${{ matrix.plugin-name }} demo
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: vuepress-theme-hope/${{ matrix.plugin-name }}-demo
branch: netlify
folder: demo/${{ matrix.plugin-name }}/src/.vuepress/dist
token: ${{ secrets.ACCESS_TOKEN }}
single-commit: true