-
Notifications
You must be signed in to change notification settings - Fork 90
/
.travis.yml
44 lines (37 loc) · 1.15 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
language: r
cache:
directories:
- _bookdown_files
- $HOME/.npm
- $HOME/.local/share/renv
- $TRAVIS_BUILD_DIR/renv/library
pandoc_version: 2.1.1
env:
global:
- NETLIFY_SITE_ID=22cbd49d-9d4d-462f-9d28-a797fa14a11d
# NETLIFY_AUTH_TOKEN set in travis settings
- RENV_CONFIG_REPOS_OVERRIDE=https://demo.rstudiopm.com/all/__linux__/xenial/latest
before_install:
- export COMMIT_MSG=$(echo "$TRAVIS_COMMIT_MESSAGE" | head -n1)
- export DEPLOY_MSG="${TRAVIS_COMMIT:0:7} ${COMMIT_MSG:0:50}"
- Rscript -e "renv::restore()"
install:
- Rscript -e 'old.packages(repos = Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE"), lib.loc = .libPaths()[1])'
script:
- Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)'
- cp _redirects _book/_redirects
before_cache:
- nvm install stable
- npm install netlify-cli -g
deploy:
- provider: script
script: netlify deploy --dir _book --prod --message "$DEPLOY_MSG"
skip_cleanup: true
on:
branch: master
- provider: script
script: netlify deploy --dir _book --message "$DEPLOY_MSG"
skip_cleanup: true
on:
all_branches: true
condition: $TRAVIS_BRANCH != "master"