Skip to content

Commit

Permalink
Automatic building of docs through travis
Browse files Browse the repository at this point in the history
  • Loading branch information
demianw committed Feb 3, 2018
1 parent a9c2ac0 commit 00320e8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ install:
script:
- flake8 --ignore N802,N806,E731,F401 `find . -name \*.py | grep -v setup.py | grep -v /doc/`
- nosetests --with-coverage -v
- travis-sphinx build -s doc
#- travis-sphinx build -s doc
#- for a in examples/*ipynb; do
# echo $a;
# jupyter nbconvert --execute $a >/dev/null;
Expand All @@ -74,4 +74,6 @@ script:
after_success:
- coveralls
- codecov -t a66df7b8-efce-412e-9ea8-2598b09b186e
- travis-sphinx deploy

deploy:
- cd doc; make html && ./push.sh
33 changes: 33 additions & 0 deletions doc/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# Push HTML files to gh-pages automatically.

# Fill this out with the correct org/repo
ORG=AthenaEPI
REPO=dmipy
# This probably should match an email for one of your users.
EMAIL=demian.wassermann@inria.fr

set -e

# Clone the gh-pages branch outside of the repo and cd into it.
cd ..
git clone -b gh-pages "https://$GH_TOKEN@github.com/$ORG/$REPO.git" gh-pages
cd gh-pages

# Update git configuration so I can push.
if [ "$1" != "dry" ]; then
# Update git config.
git config user.name "Travis Builder"
git config user.email "$EMAIL"
fi

# Copy in the HTML. You may want to change this with your documentation path.
cp -R ../$REPO/_build/html/* ./

# Add and commit changes.
git add -A .
git commit -m "[ci skip] Autodoc commit for $COMMIT."
if [ "$1" != "dry" ]; then
# -q is very important, otherwise you leak your GH_TOKEN
git push -q origin gh-pages
fi

0 comments on commit 00320e8

Please sign in to comment.