Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.31 KiB
Newer Older
Jacek Lebioda's avatar
Jacek Lebioda committed
# In case something goes horribly wrong, you can fall back to `image: ruby:latest`
image: git-r3lab.uni.lu:4567/r3/docker/jekyll-lcsb:1.4
Christophe Trefois's avatar
Christophe Trefois committed

# This will try to build the web site, and store the result in "build" directory
build the web site:
Christophe Trefois's avatar
Christophe Trefois committed
  stage: test
  variables:
    JEKYLL_ENV: production
Christophe Trefois's avatar
Christophe Trefois committed
  artifacts:
    expire_in: 3 days
Christophe Trefois's avatar
Christophe Trefois committed
    paths:
    - build  
  before_script:
  - bundle install
  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 build --config "_config.yml,_config_ci.yml"
Christophe Trefois's avatar
Christophe Trefois committed

# This will actually deploy the web site when pushing to master
Christophe Trefois's avatar
Christophe Trefois committed
pages:
  stage: deploy
  rules:
    # Run only on branch named "latest"
    - if: $CI_COMMIT_BRANCH == "latest"
Christophe Trefois's avatar
Christophe Trefois committed
  script:
  - mv build public
  - echo "Your website is available at $CI_PAGES_URL"
Christophe Trefois's avatar
Christophe Trefois committed
  artifacts:
    expire_in: 3 days
Christophe Trefois's avatar
Christophe Trefois committed
    paths:
    - public

Jacek Lebioda's avatar
Jacek Lebioda committed
# This will push the gem to ruby-gems when tagged
    - mkdir -p ~/.gem && echo "$API_KEY_BASE64" | base64 --decode > ~/.gem/credentials && chmod 0600 ~/.gem/credentials
    - gem build jekyll-theme-lcsb-default.gemspec && gem push jekyll-theme-lcsb-default*.gem
  rules:
    # Run only on master...
    - if: $CI_COMMIT_TAG