在Travis上构建图书并返回GitHub页面
我正在使用托管在GitHub上的在Travis上构建图书并返回GitHub页面,r,travis-ci,bookdown,R,Travis Ci,Bookdown,我正在使用托管在GitHub上的bookdown编写一本书,一个令人沮丧的是,在我将更改推回到GitHub之前,我一直忘记构建这本书。因此,我提出的一个解决方案是使用Travis构建我的书并将其部署到gh页面分支。我正在使用htmlproofer检查我书中的链接,因此我需要我的Travis build使用ruby语言,而不是R。但是,我看不到如何访问Rscript命令,因为它没有安装在环境中。我当前的.travis.yml是 language: ruby rvm: - 2.3.3 befor
bookdown
编写一本书,一个令人沮丧的是,在我将更改推回到GitHub之前,我一直忘记构建这本书。因此,我提出的一个解决方案是使用Travis构建我的书并将其部署到gh页面
分支。我正在使用htmlproofer
检查我书中的链接,因此我需要我的Travis build使用ruby
语言,而不是R
。但是,我看不到如何访问Rscript
命令,因为它没有安装在环境中。我当前的.travis.yml
是
language: ruby
rvm:
- 2.3.3
before_script:
- chmod +x ./scripts/cibuild.sh
script:
- ./scripts/cibuild.sh
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
local_dir: docs
on:
branch: master
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
notifications:
email: false
sudo: false
其中cibuild
只是一个bash
脚本,包含
#!/bin/sh
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::gitbook')"
htmlproofer ./docs
我尝试使用sudo apt get install r-base
,但这给了我r
版本2.14.1
,它太旧了
有什么想法吗?为了解决这个问题,我切换到了
语言:R
构建,因为这也是Ruby自带的。答案是详细的从PPA中添加R?所以sudo添加apt存储库ppa:marutter/rdev
?然后sudo apt get install r-base
?那应该会给我最新版本吧?可能需要sudo添加apt存储库ppa:marutter/rdev
然后sudo-apt-get-update-yy
,最后sudo-apt-get-install r-base