diff --git a/doc/.gitignore b/doc/.gitignore index fad74e7..9263f9f 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1 +1,2 @@ doctrees +gh-pages diff --git a/doc/Makefile b/doc/Makefile index 0996225..2cc1320 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -18,3 +18,7 @@ help: # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + + +gh-pages: + @./update-gh-pages.sh diff --git a/doc/update-gh-pages.sh b/doc/update-gh-pages.sh new file mode 100755 index 0000000..fe26308 --- /dev/null +++ b/doc/update-gh-pages.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -ex +CLONE_URL=$(git remote -v | grep origin | head -n1 | awk '{print $2}') +if [ ! -d gh-pages ]; then + git clone -b gh-pages ${CLONE_URL} gh-pages +else + (cd gh-pages && git pull origin gh-pages) +fi + +cd gh-pages +rm -rf * +cp -r ../html/* . +git add -A +git commit -m 'Update docs' +git push origin gh-pages