我正在写一本bookdown
托管在 GitHub 上的书,一个令人沮丧的是,在我将更改推回 GitHub 之前,我一直忘记构建这本书。所以我想出的一个解决方案是使用 Travis 构建我的书并将其部署到gh-pages
分支。我htmlproofer
用来检查我书中的链接,所以我需要我的 Travis 构建来使用该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
我尝试使用 asudo apt-get install r-base
但这给了我太旧的R
版本......2.14.1
有任何想法吗?