.gitlab-ci.yml 1.12 KB
Newer Older
1 2 3 4
# Assumes ruby-dev, ruby-bundle, jq and LaTeX are installed in the runner.
# We do not use the Debian package for Jekyll because Buster has only 3.8.3
# (while we want at least 3.8.4).

Houtan Bastani's avatar
Houtan Bastani committed
5
variables:
Houtan Bastani's avatar
Houtan Bastani committed
6
  GIT_SUBMODULE_STRATEGY: normal
Houtan Bastani's avatar
Houtan Bastani committed
7 8
  TERM: linux

Sébastien Villemot's avatar
Sébastien Villemot committed
9
build:
Houtan Bastani's avatar
Houtan Bastani committed
10
  stage: build
Sébastien Villemot's avatar
Sébastien Villemot committed
11 12
  variables:
    JEKYLL_ENV: production
13 14 15 16
    LC_ALL: C.UTF-8
    LANG: en_US.UTF-8
    LANGUAGE: en_US.UTF-8
    GEM_HOME: "$CI_PROJECT_DIR/.gem"
Sébastien Villemot's avatar
Sébastien Villemot committed
17 18
  before_script:
    - gem install jekyll
19
    - (cd _data && wget --no-verbose --no-parent --accept '*.rdf' --recursive --no-directories --execute robots=off https://www.dynare.org/RePEc/cpm/dynare/ && ../assets/RePEc/rdf2yml.sh && rm -f *.rdf)
20
    - ./setup-download-links.sh
Sébastien Villemot's avatar
Sébastien Villemot committed
21
    - bundle install
Houtan Bastani's avatar
Houtan Bastani committed
22
  script:
Houtan Bastani's avatar
Houtan Bastani committed
23
    - (cd assets/images/logo && make)
Houtan Bastani's avatar
Houtan Bastani committed
24
    - bundle exec jekyll build
25 26 27 28
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
      - .gem/
Houtan Bastani's avatar
Houtan Bastani committed
29 30 31 32
  artifacts:
    paths:
    - _site

Sébastien Villemot's avatar
Sébastien Villemot committed
33 34
deploy:
  stage: deploy
35 36 37 38
  rules:
    - if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_REF_NAME == "master"'
      when: on_success
    - when: never
Sébastien Villemot's avatar
Sébastien Villemot committed
39
  tags:
40
    - restricted
Sébastien Villemot's avatar
Sébastien Villemot committed
41 42 43
  dependencies:
    - build
  script:
44
    - cp -a _site/* /srv/www.dynare.org/