image: ruby:2.6 stages: - test - deploy - release # This will try to build the web site, and store the result in "build" directory test: stage: test variables: JEKYLL_ENV: production artifacts: expire_in: 3 days 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" # This will actually deploy the web site when pushing to master pages: stage: deploy only: - master script: - mv build public - echo "Your website is available at $CI_PAGES_URL" artifacts: expire_in: 3 days paths: - public # This will push the gem to ruby-gems when tagged release: stage: release script: - 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 only: - tags