5
0
mirror of https://git.coop/cotech/website.git synced 2024-11-04 23:48:43 +00:00
cotech-website/.gitlab-ci.yml
Nick Sellen 7101fedabe Cache all of /usr/local/bundle/
... it doesn't seem to be caching properly but perhaps that's
because it's not setup in the runner properly yet...
2018-11-29 18:23:36 +00:00

59 lines
1.1 KiB
YAML

image: ruby:2.5.3
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
cache:
key: gems
paths:
- /usr/local/bundle/
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
test:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
except:
- master
deploy:production:
stage: deploy
script:
- bundle exec jekyll build -d public
- rsync -aqz public/ cotech@webarch2.co.uk:sites/default/
artifacts:
paths:
- public
environment:
name: production
url: https://static.coops.tech
only:
- master
deploy:dev:
stage: deploy
script:
- bundle exec jekyll build -d public
- rsync -aqz public/ cotech@webarch2.co.uk:sites/dev/
artifacts:
paths:
- public
environment:
name: dev
url: https://dev.static.coops.tech
only:
- dev