Revise CI

- deploy using GitLab pages
- use jekyll image rather than installing loads of stuff manually
- gzip static resources for better performance
This commit is contained in:
Anna Sidwell 2019-11-13 20:03:47 +00:00
parent 4394fdb749
commit adcd1ceec4

View File

@ -1,21 +1,28 @@
image: ruby:2.4
stages: stages:
- deploy - deploy
deploy: variables:
GIT_DEPTH: 1
pages:
image: jekyll/jekyll:3.6
stage: deploy stage: deploy
before_script:
- apt-get update -y
- apt-get -y install rsync
- gem install jekyll -v 3.6.0
- eval $(ssh-agent -s)
script: script:
- rm Gemfile
- jekyll build -d public - jekyll build -d public
- ssh-add <(echo "$SSH_PRIVATE_KEY") - apk add gzip --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
- rsync -rvz --delete -e 'ssh -o StrictHostKeyChecking=no' ./public/ "$SERVER_USER"@autonomic.zone:/var/www/autonomic.zone/html/ - gzip -v -k -6 $(find public -name '*.js' -o -name '*.html' -o -name '*.css')
artifacts: artifacts:
paths: paths:
- public - public
only: only:
- master - master
test with latest jekyll:
image: jekyll/jekyll:latest
stage: deploy
script:
- rm Gemfile
- jekyll build -d public