2017-09-11 12:26:47 +00:00
|
|
|
image: ariejan/dockerized-hugo:latest
|
2015-12-04 14:09:01 +00:00
|
|
|
|
2017-09-04 13:39:20 +00:00
|
|
|
test:
|
|
|
|
script:
|
2017-10-16 14:12:17 +00:00
|
|
|
# Compile
|
2017-09-04 13:39:20 +00:00
|
|
|
- hugo
|
2017-10-16 14:12:17 +00:00
|
|
|
|
|
|
|
# Compress CSS
|
|
|
|
- yui-compressor public/css/style.css -o public/css/style-min.css
|
|
|
|
- mv -f public/css/style-min.css public/css/style.css
|
|
|
|
|
|
|
|
# Mogrify thumbnails
|
|
|
|
- mkdir -p public/img/low
|
|
|
|
- cd public/img
|
2017-10-16 14:21:45 +00:00
|
|
|
- mogrify -format gif -path low -thumbnail 724> *.gif
|
|
|
|
- mogrify -format png -path low -thumbnail 724> *.png
|
|
|
|
- mogrify -format jpg -path low -thumbnail 724> *.jpg
|
2017-10-16 14:12:17 +00:00
|
|
|
|
2017-09-04 13:39:20 +00:00
|
|
|
except:
|
|
|
|
- master
|
|
|
|
|
|
|
|
pages:
|
|
|
|
before_script:
|
|
|
|
# Setup SSH keys
|
|
|
|
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- ssh-add <(echo "$SSH_PRIVATE_KEY")
|
|
|
|
- mkdir -p ~/.ssh
|
2017-09-04 13:44:02 +00:00
|
|
|
- '[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts'
|
2017-03-16 14:35:25 +00:00
|
|
|
|
2015-12-04 14:09:01 +00:00
|
|
|
script:
|
2017-09-04 13:39:20 +00:00
|
|
|
# Compile
|
2015-12-04 14:34:29 +00:00
|
|
|
- hugo
|
2017-09-04 13:39:20 +00:00
|
|
|
|
|
|
|
# Compress CSS
|
2017-09-11 12:20:15 +00:00
|
|
|
- yui-compressor public/css/style.css -o public/css/style-min.css
|
|
|
|
- mv -f public/css/style-min.css public/css/style.css
|
2017-03-16 14:35:25 +00:00
|
|
|
|
2017-10-16 14:12:17 +00:00
|
|
|
# Mogrify thumbnails
|
|
|
|
- mkdir -p public/img/low
|
|
|
|
- cd public/img
|
2017-10-16 14:21:45 +00:00
|
|
|
- mogrify -format gif -path low -thumbnail 724> *.gif
|
|
|
|
- mogrify -format png -path low -thumbnail 724> *.png
|
|
|
|
- mogrify -format jpg -path low -thumbnail 724> *.jpg
|
2017-10-16 14:12:17 +00:00
|
|
|
|
2017-09-04 13:39:20 +00:00
|
|
|
# Deploy
|
2017-09-04 13:45:18 +00:00
|
|
|
- rsync -az4 --stats --delete-after public/* ariejan@mail.devroom.io:/home/ariejan/www/devroom.io/
|
2017-03-16 14:35:25 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
environment:
|
|
|
|
name: production
|
|
|
|
url: https://www.devroom.io
|
|
|
|
only:
|
|
|
|
- master
|