Deployment of pages with R-travis fails with pkgdown when vignettes includes the current package

gh-pages
#1

Hi,

I am trying to deploy on gh-pages with pkgdown, using the following code in .travis.yml

r_packages:
  - covr
  - pkgdown

after_success:
  - Rscript -e 'pkgdown::build_site()'
deploy:
   - provider: pages
     skip-cleanup: true
     github-token: $GITHUB_TOKEN
     local_dir: "docs"
      keep-history: true
     on:
       branch: master

The result of the Travis build shows that everything works fine until the call to build_article()

── Building articles 
 ───────────────────────────────────────────────────────────
Writing 'articles/index.html'
Reading 'vignettes/Import_data.Rmd'
Error in library(PLNmodels) : there is no package called 'PLNmodels'

Indeed, I need to load my own package in the vignette Import_data.Rmd : did I miss something in the Travis or pkgdown config ?

Note that the page build process works fine locally when I call the pkgdown::build_site() function.

Any idea ? @jimhester or @jeroen

Thanks

#2

The travis scripts build and check your package, but they do not install it. You can do this yourself, though. This should work:

after_success:
  - Rscript -e 'devtools::install()'
  - Rscript -e 'pkgdown::build_site()'
#3

Thanks, it works, indeed. In fact, I used

after_success:
        - R CMD INSTALL .
        - Rscript -e 'pkgdown::build_site()'

Any reason for preferring Rscript -e 'devtools::install()' ?

1 Like
#4

That code was adapted from what I am actually using, which looks more like:

deploy:
  provider: script
  script: Rscript -e 'devtools::install(); pkgdown::deploy_site_github()'
  skip_cleanup: true

In the deploy step you cannot use multiple commands. A shell script seemed to much and the above form looks nicer to me than R CMD INSTALL . && Rscript -e 'pkgdown::deploy_site_github()'.