diff --git a/.travis.yml b/.travis.yml index eeb21d97..93dd724f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,10 @@ addons: - texlive-latex-extra - dvipng - python-qt4 +env: + global: + - GH_REF: github.com/scikit-image/docs.git + - secure: "M/t6G0+xYC9c7vjCOdbGj/2m5YKIWCrSpuk1a93ql/bQrF+l5Cdwt3VSTx9mkNFpx1WZgz1We+9OBG0OMR+N/WDLESAlx6L0QRoNBL8+KyKcw3/+MdGjVsFzSq4mJsLW3eEZ35U9PI81/JEyWg6GybjheikzaoW8uPyKTu2Qzmc=" notifications: webhooks: @@ -49,3 +53,4 @@ script: tools/travis_script.sh after_success: - coveralls + - bash tools/deploy_docs.sh diff --git a/doc/ext/notebook.py b/doc/ext/notebook_doc.py similarity index 100% rename from doc/ext/notebook.py rename to doc/ext/notebook_doc.py diff --git a/doc/ext/plot2rst.py b/doc/ext/plot2rst.py index 32811deb..da6ff849 100644 --- a/doc/ext/plot2rst.py +++ b/doc/ext/plot2rst.py @@ -82,7 +82,7 @@ from skimage import io from skimage import transform from skimage.util.dtype import dtype_range -from notebook import Notebook +from notebook_doc import Notebook from docutils.core import publish_parts from sphinx.domains.python import PythonDomain diff --git a/tools/deploy_docs.sh b/tools/deploy_docs.sh new file mode 100644 index 00000000..b2c5a2ec --- /dev/null +++ b/tools/deploy_docs.sh @@ -0,0 +1,21 @@ +#!/bin/bash +if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_BRANCH == "master" ]] +then + echo "-- pushing docs --" + + ( + git config user.email "travis@travis-ci.com" + git config user.name "Travis Bot" + + git clone --quiet --branch=gh-pages https://${GH_REF} doc_build + rm -r doc_build/dev + cp -r doc/build/html doc_build/dev + + cd doc_build + git add dev + git commit -m "Deployed to GitHub Pages" + git push --force --quiet "https://${GHTOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 + ) +else + echo "-- will only push docs from master --" +fi