devroom.io/.gitlab-ci.yml

55 lines
1.3 KiB
YAML

image: ariejan/dockerized-hugo:latest
test:
script:
# Compile
- hugo
# 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
- mogrify -format png -path low -thumbnail 724 *.png
- mogrify -format jpg -path low -thumbnail 724 *.jpg
- cd ../..
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
- '[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts'
script:
# Compile
- hugo
# 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
- mogrify -format png -path low -thumbnail 724 *.png
- mogrify -format jpg -path low -thumbnail 724 *.jpg
# Deploy
- rsync -az4 --stats --delete-after public/* ariejan@mail.devroom.io:/home/ariejan/www/devroom.io/
artifacts:
paths:
- public
environment:
name: production
url: https://www.devroom.io
only:
- master