-
Notifications
You must be signed in to change notification settings - Fork 19
46 lines (44 loc) · 1.27 KB
/
doc.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
name: Doc
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 12.18.2
- name: install gitbook
run: npm install gitbook-cli gitbook-summary -g
- name: set timezone
run: sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
- name: install
run: gitbook install
- name: clear README.md
run: echo "" > README.md
- name: generate-toc
run: book sm --disableTitleFormatting
- name: build
run: gitbook build
- name: install git
run: sudo apt-get install git -y
- name: publish
env:
ACCESS_TOKEN: ${{ secrets.AWESOME_PUBLISH_TOKEN }}
run: |
mkdir -p deploy-doc-dir
cd deploy-doc-dir
rm -rf *
git init
git config user.name "weiliang-ms"
git config user.email "[email protected]"
ls -R ../_book
mv ../_book docs
git add docs
git commit -m "Update docs"
git push --force "https://[email protected]/weiliang-ms/wl-awesome" master:docs