Skip to content
Snippets Groups Projects

Intégration des paramètres version, last_year et filepath_data_ars

1 file
+ 80
0
Compare changes
  • Side-by-side
  • Inline
.gitlab-ci.yml 0 → 100644
+ 80
0
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:
- main
script:
- Rscript -e 'remotes::install_cran(c("pkgdown"), upgrade = "never")'
- Rscript -e 'pkgdown::build_site()'
artifacts:
paths:
- docs
expire_in: 30 days
integration-main:
stage: pkgdown-move
dependencies:
- integration
only:
- main
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/main/download?job=pages" &&
unzip artifacts.zip &&
rm artifacts.zip &&
echo "copied main artifacts" ||
echo "copied main 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
pages:
stage: deploy
script:
- echo "deployment with cache"
- ls -la public || echo "Public directory does not exist"
artifacts:
paths:
- public
only:
- main
Loading