38 lines
789 B
YAML
38 lines
789 B
YAML
image: ruby:2.5.3
|
|
|
|
variables:
|
|
JEKYLL_ENV: production
|
|
LC_ALL: C.UTF-8
|
|
|
|
before_script:
|
|
- 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
|
|
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
|
|
- 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
|
|
|
|
pages:
|
|
stage: deploy
|
|
script:
|
|
- bundle exec jekyll build -d public
|
|
- rsync -avz public/ cotech@webarch2.co.uk:sites/default/
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
only:
|
|
- master
|