devroom.io/.gitlab-ci.yml

56 lines
1.4 KiB
YAML
Raw Normal View History

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/thumbs
2017-10-16 14:12:17 +00:00
- cd public/img
- 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
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/thumbs
2017-10-16 14:12:17 +00:00
- cd public/img
- 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:31:10 +00:00
- rsync -az4 -e 'ssh -i ~/.ssh/id_rsa' --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