Commit a1d61ce6 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

deployment script

parent 2596bbff
Pipeline #28496 passed with stages
in 5 minutes and 15 seconds
......@@ -7,8 +7,8 @@ build the website:
- gem install bundler -v2.0.2
- bundle install && bundle update jekyll-theme-lcsb-default && bundle update jekyll-theme-lcsb-frozen-components
script:
- 'echo "baseurl: /$CI_PROJECT_NAME" >> _config_ci.yml'
- 'echo "url: https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN" >> _config_ci.yml'
- 'echo "baseurl: " >> _config_ci.yml'
- 'echo "url: https://dapi.lcsb.uni.lu" >> _config_ci.yml'
- bundle exec jekyll build -d test --config "_config.yml,_config_ci.yml"
- 'echo $CI_COMMIT_SHA > test/version'
artifacts:
......@@ -18,14 +18,23 @@ build the website:
variables:
JEKYLL_ENV: production
pages:
website_deploy:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == "master"
only:
- master
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIV_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- echo "$VM_SSH_KNOWNHOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
script:
- mv test public
- rsync -azh -e "ssh -p 8022" test/ gitlab-deploy@10.240.6.84:~/dapi-home-page/
- echo "Your website is available at $CI_PAGES_URL"
artifacts:
expire_in: 1 week
paths:
- public
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment