.gitlab-ci.yml 1 KB
Newer Older
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
stages:
    - check
    - website

default:
  tags: [docker]

image: rocker/tidyverse:4.0.5

variables:
  R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib"
  CHECK_DIR: "$CI_PROJECT_DIR/ci/logs"
  BUILD_LOGS_DIR: "$CI_PROJECT_DIR/ci/logs/$CI_PROJECT_NAME.Rcheck"

cache:
  paths:
    - $R_LIBS_USER

before_script:
  - mkdir -p $R_LIBS_USER $BUILD_LOGS_DIR
  - echo "R_LIBS='$R_LIBS_USER'" > .Renviron
  - R -e 'devtools::install_deps(dep = T)'

check:
  stage: check
  script:
    - if [[ $NOT_CRAN == "false" ]]; then sudo apt-get update && sudo apt-get install -y qpdf; fi
    - R -e 'rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning")'

website:
  stage: website
  only:
    - master
    - dev
    - tags
  script:
    - R -e 'devtools::update_packages(packages = "pkgdown")'
    - R -e 'pkgdown::build_site()'
    - sudo apt-get update && sudo apt-get install -y sshpass rsync
    - sshpass -p "${OVH_PASS}" rsync -a -e "ssh -o StrictHostKeyChecking=no" docs/ ${OVH_LOGIN}@${OVH_SFTP}:/home/${OVH_LOGIN}/in-wop/bnpe/