-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (50 loc) · 1.44 KB
/
docs.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
name: Documentation Build
on:
push:
branches:
- master
- main
# allow actions to edit the project
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Copy project to machine
uses: actions/checkout@v3
with:
# 确保可以 Dumi 可以拿到正确的最后更新时间,当配置 themeConfig.lastUpdated 为 true
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node: 18
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6
- name: Restore node_modules
id: restore-node-modules
uses: actions/cache/restore@v3
with:
path: node_modules
key: cache-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install dependencies
if: steps.restore-node-modules.outputs.cache-hit != 'true'
run: pnpm install
- name: Cache node_modules
if: steps.restore-node-modules.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: node_modules
key: ${{ steps.restore-node-modules.outputs.cache-primary-key }}
- name: Build docs
run: pnpm docs:build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs-dist
branch: gh-pages
clean: true
clean-exclude: CNAME