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
|
2017-11-13 21:42:49 +00:00
|
|
|
- mkdir -p public/img/thumbs
|
2017-10-16 14:12:17 +00:00
|
|
|
- cd public/img
|
2017-11-13 21:42:49 +00:00
|
|
|
- mogrify -format png -path thumbs -thumbnail 724 *.png
|
|
|
|
- mogrify -format jpg -path thumbs -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
|
2018-08-31 14:22:37 +00:00
|
|
|
- mkdir -p ~/.ssh # Setup SSH
|
|
|
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
|
|
|
|
- chmod 600 ~/.ssh/id_rsa
|
|
|
|
- ssh-keyscan -H 'mail.devroom.io' >> ~/.ssh/known_hosts
|
2018-08-31 14:26:29 +00:00
|
|
|
- rsync --version
|
|
|
|
- hugo version
|
2018-08-31 14:39:05 +00:00
|
|
|
- ssh -vv ariejan@mail.devroom.io exit; echo $?
|
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
|
2017-11-13 21:42:49 +00:00
|
|
|
- mkdir -p public/img/thumbs
|
2017-10-16 14:12:17 +00:00
|
|
|
- cd public/img
|
2017-11-13 21:42:49 +00:00
|
|
|
- mogrify -format png -path thumbs -thumbnail 724 *.png
|
|
|
|
- mogrify -format jpg -path thumbs -thumbnail 724 *.jpg
|
2017-10-16 14:12:17 +00:00
|
|
|
|
2017-09-04 13:39:20 +00:00
|
|
|
# Deploy
|
2017-10-16 14:29:17 +00:00
|
|
|
- cd "$CI_PROJECT_DIR"
|
2018-08-31 14:37:47 +00:00
|
|
|
- rsync -az4 -e 'ssh -i ~/.ssh/id_rsa -l ariejan' --stats --delete-after public/* 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
|