Select Git revision
.gitlab-ci.yml
.gitlab-ci.yml 2.17 KiB
image: rocker/geospatial:latest
variables:
GIT_DEPTH: 10
REPO_NAME: "https://packagemanager.rstudio.com/all/__linux__/focal/latest"
R_LIBS: "ci/lib"
cache:
key: global-cache
paths:
- ${R_LIBS}
stages:
- build
- pkgdown
- pkgdown-move
- deploy
building:
stage: build
script:
- apt-get update -qq && apt-get install -y libharfbuzz-dev libfribidi-dev
- echo "Library path for packages :" $R_LIBS
- mkdir -p $R_LIBS
- Rscript -e 'install.packages("remotes")'
- Rscript -e 'install.packages("rcmdcheck")'
- Rscript -e 'remotes::install_local(upgrade = "never")'
- Rscript -e 'remotes::install_git("https://gitlab-forge.din.developpement-durable.gouv.fr/dreal-pdl/csd/data.nitrates.git")'
- R -e 'rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check")'
- ls -la
- mkdir -p public
- ls -la public
- ls -la $R_LIBS
integration:
stage: pkgdown
allow_failure: true
when: on_success
only:
- master
script:
- Rscript -e 'remotes::install_cran(c("pkgdown"), upgrade = "never")'
- Rscript -e 'pkgdown::build_site()'
artifacts:
paths:
- docs
expire_in: 30 days
integration-master:
stage: pkgdown-move
dependencies:
- integration
only:
- master
script:
- mkdir -p public
- echo "test file" > public/test.txt
- 'curl --location --output artifacts.zip --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/master/download?job=pages" &&
unzip artifacts.zip &&
rm artifacts.zip &&
echo "copied master artifacts" ||
echo "copied master artifacts failed"'
- ls -la docs || echo "Docs directory does not exist or is empty"
- cp -r docs/* public || echo "No files to copy"
- ls -la public
artifacts:
paths:
- public
expire_in: 30 days