Skip to content

Commit 736fbe5

Browse files
committed
ci(docs): auto build docs
close #4
1 parent ee9a5ff commit 736fbe5

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ python:
44
- "3.5"
55
- "3.6"
66
install:
7-
- pip install -r requirements.txt
7+
- pip install -r dev-requirements.txt
88
- pip install pytest-pep8
99
script:
10-
- make ci
10+
- make ci
11+
- make build-docs && make publish-docs

Makefile

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1+
GH_REF :=github.com/snnucs/SNNU-SDK.git
12
ci:
23
python -m unittest
34
pytest --pep snnusdk
4-
pytest test
5+
pytest test
6+
build-docs:
7+
cd docs && make html && cd ..
8+
@echo "Build successful!"
9+
publish-docs:
10+
git clone https://${GH_REF} html
11+
ls
12+
pwd
13+
cd html && ls
14+
pwd
15+
git checkout -b gh-pages
16+
git pull
17+
pwd
18+
cd ..
19+
sudo mv html/.git/ docs/SNNU-SDK-docs/
20+
cd docs/SNNU-SDK-docs
21+
pwd
22+
ls
23+
rm -rf doctrees
24+
git config --global user.name "Qi Zhao"
25+
git config --global user.email "[email protected]"
26+
git add .
27+
git commit -m "Travis CI Auto Builder at `date +"%Y-%m-%d %H:%M"`"
28+
git push --quiet "https://${GH_TOKEN}@${GH_REF}" gh-pages:gh-pages

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
SOURCEDIR = source
8-
BUILDDIR = ../../SNNU-SDk-docs
8+
BUILDDIR = SNNU-SDk-docs
99

1010
# Put it first so that "make" without argument is like "make help".
1111
help:

docs/make.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if "%SPHINXBUILD%" == "" (
88
set SPHINXBUILD=sphinx-build
99
)
1010
set SOURCEDIR=source
11-
set BUILDDIR=../../SNNU-SDk-docs
11+
set BUILDDIR=SNNU-SDk-docs
1212

1313
if "%1" == "" goto help
1414

0 commit comments

Comments
 (0)