.gitlab-ci.yml 761 Bytes
Newer Older
Davide Depau's avatar
Davide Depau committed
1 2
image: jekyll/builder

Davide Depau's avatar
Davide Depau committed
3 4 5
stages:
  - deploy

Davide Depau's avatar
Davide Depau committed
6 7 8
variables:
  JEKYLL_ENV: production
  LC_ALL: C.UTF-8
9
  GIT_SUBMODULE_STRATEGY: recursive
Davide Depau's avatar
Davide Depau committed
10

11
before_script:
Davide Depau's avatar
Davide Depau committed
12
  - ./scripts/ci_fix_baseurl.sh
13

Davide Depau's avatar
Davide Depau committed
14
deploy-prod:
15 16
  stage: deploy
  script:
Davide Depau's avatar
Davide Depau committed
17
  - apk add rsync
Davide Depau's avatar
Davide Depau committed
18 19
  - bundle install
  - jekyll build -d public
20 21
  - mkdir -p "$HOME/.ssh"
  - echo "$SSH_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts"
Davide Depau's avatar
Davide Depau committed
22
  - rsync -e "ssh -i $SSH_DEPLOY_KEY" --delete-after -rlptP public/ "$SSH_DEPLOY_USER@$SSH_DEPLOY_HOST:/www.poul.org/"
Davide Depau's avatar
Davide Depau committed
23 24 25
  cache:
    key: gems
    paths:
26
    - "/usr/local/bundle"
27 28 29 30 31
  only:
  - master

pages:
  stage: deploy
Davide Depau's avatar
Davide Depau committed
32
  script:
Davide Depau's avatar
Davide Depau committed
33 34
  - bundle install
  - jekyll build -d public
Davide Depau's avatar
Davide Depau committed
35 36 37
  artifacts:
    paths:
    - public
Davide Depau's avatar
Davide Depau committed
38 39 40
  cache:
    key: gems
    paths:
41
    - "/usr/local/bundle"
Davide Depau's avatar
Davide Depau committed
42
  only:
43
  - develop