Last active
January 10, 2016 05:25
-
-
Save agrueneberg/5c59faee22855ea3f78f to your computer and use it in GitHub Desktop.
R staticdoc on Travis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Only run on normal commits, ignore pull requests | |
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then | |
# Clone gh-pages branch into inst/web | |
git clone --branch gh-pages https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git inst/web | |
# Copy README | |
cp README.md inst/web | |
# Run staticdocs | |
Rscript -e 'library(staticdocs); library(methods); build_site(launch = FALSE)' | |
# Push changes to gh-pages branch | |
cd inst/web | |
git config user.name "Travis CI" | |
git config user.email [email protected] | |
git add -A . | |
git commit -m "Update site (Travis Build $TRAVIS_BUILD_NUMBER)." | |
git push origin gh-pages | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment