Skip to content

Commit a41990b

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

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
language: python
2-
sudo: true
32
python:
43
- "3.5"
54
- "3.6"
65
install:
7-
- pip install -r requirements.txt
6+
- pip install -r dev-requirements.txt
87
- pip install pytest-pep8
98
script:
10-
- make ci
9+
- make ci
10+
- make build-docs && bash publish-docs.sh
11+

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
ci:
22
python -m unittest
33
pytest --pep snnusdk
4-
pytest test
4+
pytest test
5+
build-docs:
6+
cd docs && make html
7+
@echo "Build successful!"
8+

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

publish-docs.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/bash
2+
export GH_REF="github.com/snnucs/SNNU-SDK.git"
3+
git clone https://${GH_REF} html
4+
cd html
5+
git checkout gh-pages
6+
git pull origin
7+
sudo mkdir SNNU-SDK-docs/.git
8+
sudo mv html/.git/ SNNU-SDK-docs/.git/
9+
cd SNNU-SDK-docs
10+
pwd
11+
rm -rf doctrees
12+
git config --global user.name "Qi Zhao"
13+
git config --global user.email "[email protected]"
14+
git add .
15+
git commit -m "Travis CI Auto Builder at `date +"%Y-%m-%d %H:%M"`"
16+
git push --quiet "https://${GH_TOKEN}@${GH_REF}" gh-pages:gh-pages

0 commit comments

Comments
 (0)