forked from svg-net/SVG
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.15 KB
/
builddocs.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
name: DocBuild
on:
push:
branches: master
defaults:
run:
shell: bash
jobs:
build_docs:
runs-on: windows-latest
steps:
- name: Checkout master
uses: actions/checkout@v2
with:
path: main
- name: Get last commit message
run: |
cd main
echo "LAST_COMMIT=$(echo `git log -1 --pretty=%B`)" >> $GITHUB_ENV
cd ..
- name: Checkout gh-pages
uses: actions/checkout@v2
with:
ref: gh-pages
path: doc
- name: Install requirements
run: choco install docfx -y
- name: Build documentation
run: |
echo `pwd`
cd main
docfx docfx.json
cd ../doc
git config --global core.autocrlf false
git config --global user.email "[email protected]"
git config --global user.name "CI Build"
cp -r ../main/_site/* .
git add -A
if [ `git status -s | wc -l` = 0 ]; then
echo "No changes in built documentation, skipping"
exit 0
fi
git commit -m "$LAST_COMMIT" -q
git push origin gh-pages -q