5
0
mirror of https://git.coop/cotech/website.git synced 2024-11-14 03:40:50 +00:00
cotech-website/.gitlab-ci.yml
James Mead d5a260c00e Update Ruby to v2.6.6
This is the latest patch version of v2.6.
2020-10-11 14:47:35 +01:00

68 lines
1.2 KiB
YAML

image: ruby:2.6.6
stages:
- test
- staging
- production
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
cache:
key: gems
paths:
- vendor
before_script:
- 'which rsync || ( apt-get update -qq && apt-get install rsync -yqq )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- bundle install --path vendor
test:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
except:
- master
deploy:dev:
stage: staging
script:
- bundle exec jekyll build -d public
- rsync -aqz --delete-after public/ cotech@webarch2.co.uk:sites/dev/
artifacts:
paths:
- public
environment:
name: dev
url: https://dev.coops.tech
only:
- master
deploy:production:
stage: production
script:
- bundle exec jekyll build -d public
- rsync -aqz --delete-after public/ cotech@webarch2.co.uk:sites/default/
artifacts:
paths:
- public
environment:
name: production
url: https://www.coops.tech
only:
- master
when: manual
after_script:
- rm -rf /root/.ssh/