Skip to content

Instantly share code, notes, and snippets.

@agrueneberg
Last active January 10, 2016 05:25
Show Gist options
  • Save agrueneberg/5c59faee22855ea3f78f to your computer and use it in GitHub Desktop.
Save agrueneberg/5c59faee22855ea3f78f to your computer and use it in GitHub Desktop.
R staticdoc on Travis
#!/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 travis@travis-ci.org
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