# 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.0 build the website: stage: build before_script: - gem install bundler -v2.0.2 - bundle install && bundle update jekyll-theme-lcsb-default && bundle update jekyll-theme-lcsb-frozen-components script: - bundle exec jekyll build -d build --config "_config.yml,_config_staticpages.yml" - 'echo $CI_COMMIT_SHA > build/version' artifacts: expire_in: 3 days paths: - build variables: JEKYLL_ENV: production ## Deploys the website to a separate VM Deploy to production: stage: deploy image: alpine:3.1 before_script: - 'which ssh-agent || ( apk add --update openssh )' - eval $(ssh-agent -s) - echo "$SSHPRIVKEY" | tr -d '\r' | ssh-add - > /dev/null - mkdir -p ~/.ssh && chmod 700 ~/.ssh - 'echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - echo "$KNOWNHOSTS" > ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts script: # don't forget to create ~/web/latest folder manually in the initial configuration on the VM! - ssh -p $SSHPORT $SSHCONNECT "mkdir -p ~/web/web_$CI_JOB_ID" - scp -P $SSHPORT -r build/* $SSHCONNECT:~/web/web_$CI_JOB_ID - ssh -p $SSHPORT $SSHCONNECT "cd ~/web/latest && ln -fs ../web_$CI_JOB_ID/* . && cd .. && find . -type d -not -newermt '-1 minutes' -exec rm -rf {} +;"