-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
50 lines (42 loc) · 1.16 KB
/
.gitlab-ci.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
45
46
47
48
49
50
image: rocker/verse:4.2.0
stages:
- install
- deploy
install_renv:
stage: install
script: echo "Nil to do"
.bookdown:
stage: deploy
script:
- Rscript -e "bookdown::render_book('index.Rmd', output_format = c('bookdown::bs4_book', 'bookdown::markdown_document2', 'bookdown::pdf_book'), output_dir = 'public')"
artifacts:
paths:
- public
variables:
RENV_CONFIG_REPOS_OVERRIDE: "http://cran.r-project.org"
RENV_PATHS_CACHE: ${CI_PROJECT_DIR}/cache
RENV_PATHS_LIBRARY: ${CI_PROJECT_DIR}/renv/library
cache:
key: one-key-to-rule-them-all
paths:
- ${RENV_PATHS_CACHE}
- ${RENV_PATHS_LIBRARY}
before_script:
- Rscript -e "if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv')"
- Rscript -e "renv::restore()"
pages:
extends: .bookdown
only:
- master
mr-review:
extends: .bookdown
after_script:
- echo "ENVIRONMENT_URL=https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html" >> deploy.env
artifacts:
reports:
dotenv: deploy.env
environment:
name: review/$CI_COMMIT_REF_NAME
url: $ENVIRONMENT_URL
only:
- merge_requests