Last active
April 6, 2019 22:29
-
-
Save irgendwr/f9565ce07e8b1c76c957d63e5919ac2e to your computer and use it in GitHub Desktop.
GitLab CI file for deploying a hugo page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: jguyomard/hugo-builder:latest | |
stages: | |
- test | |
- deploy | |
test: | |
stage: test | |
script: | |
- hugo | |
except: | |
- master | |
deploy: | |
stage: deploy | |
before_script: | |
- mkdir -p ~/.ssh | |
- echo "$SSH_KEY" > ~/.ssh/key && chmod 600 ~/.ssh/key | |
- echo -e "Host *\n\tIdentityFile ~/.ssh/key\n\tStrictHostKeyChecking no\n\tLogLevel error\n" > ~/.ssh/config | |
script: | |
- hugo --minify | |
- rsync -rz --delete public/ $SSH_DEST | |
only: | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment