Auto-deploying documentation: better change tracking of artefacts
As part of my never-ending quest to deploy documentation better, I’ve made yet another tweak to my scripts that deploy R vignettes or Rmarkdown documents to the gh-pages
branch of my github repositories via Travis-CI.
The script from Robert Flight that’s provided the basis for most of this work does something specific to update the web facing branch of the repository. It would:
Create a blank repository
Add the requisite files to the repository
Add and commit them to the repo
Force the repo to overwrite the
gh-pages
branch
This had the unfortunate consequence of losing the history of what was previously hosted on the branch and could not tell me what commit to my development branches was responsible for a version of the docs. It took a little bit of playing but the revised script now:
Clones the gh-pages branch
Adds the requisite files into the reports
Add and commit them to the repo
Push the changes
Using an environment variable ($TRAVIS_COMMIT) the commit message is the commit ID for the latest commit in the build that occurs on Travis, making it very easy to see what changes triggered a documentation update.
This version is designed to extract generated vignettes, but the principal holds for any generated files.
[embedGitHubContent owner="stephlocke" repo="RMSFTDP" path=".push_gh_pages.sh"]
Posts in this series
- Automated documentation hosting on github via Travis-CI
- Auto-deploying documentation: multiple R vignettes
- Auto-deploying documentation: FASTER!
- Auto-deploying documentation: Rtraining
- Auto-deploying documentation: better change tracking of artefacts