-
Notifications
You must be signed in to change notification settings - Fork 34
62 lines (55 loc) · 1.65 KB
/
doc-build-action.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: PUBLISH FE-TOOLS DOCS
on:
push:
branches:
- master
# or set up your own custom triggers
permissions:
contents: write # allows the 'Commit' step without tokens
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- run: mkdir -p ./docs && rm -rf ./docs && mkdir -p ./docs
- name: Build
uses: actions/setup-node@v3
with:
node-version: 16.x
# cache: 'npm'
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- run: cd utils && pnpm install && npm run docs
- name: tar the new docs
run: tar -cvf newdocumentation.tar ./docs
- name: create a new document artifact
uses: actions/upload-artifact@v3
with:
name: newdocumentation
path: newdocumentation.tar
commit:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- run: rm -rf ./docs && mkdir -p ./docs
- name: Download the new documents artifact
uses: actions/download-artifact@v3
with:
name: newdocumentation
- run: tar -xf newdocumentation.tar ./docs -C ./docs
- run: rm newdocumentation.tar
- run: rm -rf ./docs/datas && mv -f ./datas ./docs
- name: commit
run: |
git config --global user.email "[email protected]"
git config --global user.name "MichealWayne"
git add -A
git commit -m "CI updated the documentation"
git push --quiet origin master