Skip to content

Instantly share code, notes, and snippets.

Last active June 21, 2018 00:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save MGallow/9759b2659b175233245c102e2b921231 to your computer and use it in GitHub Desktop.
Build, check, AND deploy pkgdown site for R package with Travis
# Thanks to jtilly ( for the inspiration... has since been slightly modified!
# Requires the generation of a GITHUB_TOKEN to allow Travis to access the repo. See here:
language: r
pandoc_version: 2.2.1
dist: trusty
sudo: false
- master
# cache local packages
cache: packages
# install required latex packages (if needed)
#- tlmgr install bbm
# install the package and dependencies:
# - update all installed packages
# - install package with dependencies (includes depends, imports, suggests, and linkingto)
- Rscript -e 'update.packages(ask = FALSE)'
- Rscript -e 'devtools::install(pkg = ".", dependencies = TRUE)'
# Build, check package, and create pkgdown site
- R CMD build . --no-build-vignettes --no-manual
- PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
- R CMD check "${PKG_FILE_NAME}" --no-build-vignettes --no-manual --as-cran
- travis_wait Rscript -e "pkgdown::build_site()"
# deploy site to gh-pages branch
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
branch: master
local_dir: docs
keep-history: true
allow-empty-commit: false
# send email if any changes
on_success: change
on_failure: change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment