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:
parent
4394fdb749
commit
adcd1ceec4
@ -1,21 +1,28 @@
|
||||
image: ruby:2.4
|
||||
|
||||
stages:
|
||||
- deploy
|
||||
|
||||
deploy:
|
||||
variables:
|
||||
GIT_DEPTH: 1
|
||||
|
||||
|
||||
pages:
|
||||
image: jekyll/jekyll:3.6
|
||||
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:
|
||||
- rm Gemfile
|
||||
- jekyll build -d public
|
||||
- ssh-add <(echo "$SSH_PRIVATE_KEY")
|
||||
- rsync -rvz --delete -e 'ssh -o StrictHostKeyChecking=no' ./public/ "$SERVER_USER"@autonomic.zone:/var/www/autonomic.zone/html/
|
||||
- apk add gzip --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
|
||||
- gzip -v -k -6 $(find public -name '*.js' -o -name '*.html' -o -name '*.css')
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
||||
|
||||
|
||||
test with latest jekyll:
|
||||
image: jekyll/jekyll:latest
|
||||
stage: deploy
|
||||
script:
|
||||
- rm Gemfile
|
||||
- jekyll build -d public
|
||||
|
Reference in New Issue
Block a user