-
-
Notifications
You must be signed in to change notification settings - Fork 268
62 lines (52 loc) · 1.48 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
61
62
name: Docs
on:
push:
tags:
- d*.*.*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: https://registry.npmjs.org
- name: Cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Npm Install
run: npm install
- name: Version
id: version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag#d}
echo "::set-output name=version::${version}"
- name: Npm Link # build npm
run: |
cd ./src/cnchar-types
npm link
cd ../cnchar
npm link cnchar-types
cd ../..
- name: Build # build npm
run: node ./helper/scripts/build.js ${{ steps.version.outputs.version }} all # 此处只需要build一个all即可
- name: Build Docs # build docs
run: npm run build:docs
- name: Pages # github pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs
- name: Purge # purge cdn # 此处只需要purge docs即可
run: |
node ./helper/scripts/purge-docs.js