KevCaz's Website

There are three ways to deploy a website on your GitHub pages :

  1. using the gh-pages;
  2. using the folder docs on your master branch;
  3. using the master branch.

I frequently use the GitHub pages to deploy the pkgdown websites I create for my R packages. For a while, I was using the docs/ folder where the website is generated by default. But I figured that this way has two main drawbacks:

  1. I needed to rebuild the package locally after (pretty much) any change in the package;
  2. it adds a huge amount of changes in the commit history.

That’s why I’ve decided to make Travis build the website and deploy it on the gh-branch (many developers smartly use this approach which actually is the default branch for Travis). After tweaking travis.yml (see Travis documentation about this) I ran into two problems. First, I needed a deploy key:

1
Error: No deploy key found, please setup with `travis::use_travis_deploy()`

I read the error message and fixed it 😄!. The second one was slightly more difficult (to me): the gh-branch had to be empty and as I created gh-pages from master it wasn’t! So, I’ve got the following error message:

1
2
3
Error: callr subprocess failed: '/tmp/RtmpDinJqC/file409c3dd473be' is non-empty and not built by pkgdown
Execution halted
Script failed with status 1

see this job if you want to check out the full console log.

Fortunately, the solution to fix this issue is well explained on the pkgdown website. Following the guidelines provided there, I was able to solve the two issues described above 😉!