-
Notifications
You must be signed in to change notification settings - Fork 10
/
push_docs
42 lines (34 loc) · 893 Bytes
/
push_docs
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
#!/usr/bin/env bash
# based on
# http://www.willmcginnis.com/2016/02/29/automating-documentation-workflow-with-sphinx-and-github-pages/
# Run this script in the project root
# Windows:
# use make tool from gnuwin32 and add tu system path
# http://gnuwin32.sourceforge.net/packages/make.htm
# and use Windows git shell (https://gitforwindows.org/) to run script as
# ./push_docs
# build the docs
cd sphinx
make clean
make html
cd ..
# commit and push
git add -A
git commit -m "documentation updated"
git push origin master
# switch to gh-pages branch and pull docs
git checkout gh-pages
rm -rf ./docs
rm -rf ./tutorial
rm -rf _*
touch .nojekyll
git checkout master docs/html
# move docs to root and delete docs
mv ./docs/html/* ./
rm -rf ./docs
# push updated gh-pages
git add -A
git commit -m "documentation updated"
git push origin gh-pages
# switch back to master
git checkout master