Skip to content

Instantly share code, notes, and snippets.

@irgendwr
Last active April 6, 2019 22:29
Show Gist options
  • Save irgendwr/f9565ce07e8b1c76c957d63e5919ac2e to your computer and use it in GitHub Desktop.
Save irgendwr/f9565ce07e8b1c76c957d63e5919ac2e to your computer and use it in GitHub Desktop.
GitLab CI file for deploying a hugo page
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