Skip to content
Snippets Groups Projects
.gitlab-ci.yml 667 B
Newer Older
image: ruby:2.6
Christophe Trefois's avatar
Christophe Trefois committed

build the website:
  stage: build
  before_script:
Yohan Jarosz's avatar
Yohan Jarosz committed
  - bundle install && bundle update
Christophe Trefois's avatar
Christophe Trefois committed
  script:
  - 'echo "baseurl: /$CI_PROJECT_NAME" >> _config_ci.yml'
  - 'echo "url: https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN" >> _config_ci.yml'
  - bundle exec jekyll build -d test --config "_config.yml,_config_ci.yml"
  - 'echo $CI_COMMIT_SHA > test/version'
Christophe Trefois's avatar
Christophe Trefois committed
  artifacts:
    expire_in: 3 days
Christophe Trefois's avatar
Christophe Trefois committed
    paths:
    - test
  variables:
    JEKYLL_ENV: production  
Christophe Trefois's avatar
Christophe Trefois committed

Christophe Trefois's avatar
Christophe Trefois committed
  stage: deploy
  only:
  - master
  - develop
Christophe Trefois's avatar
Christophe Trefois committed
  script:
  - mv test public
  - echo "Your website is available at $CI_PAGES_URL"
Christophe Trefois's avatar
Christophe Trefois committed
  artifacts:
    expire_in: 1 week
Christophe Trefois's avatar
Christophe Trefois committed
    paths:
    - public