Created
December 24, 2016 21:58
-
-
Save jacob-long/2fb4d75904b65721e0b00e3cf025b464 to your computer and use it in GitHub Desktop.
Hugo to DigitalOcean Wercker file
This file contains hidden or 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
box: ubuntu | |
build: | |
steps: | |
- arjen/hugo-build: | |
version: "0.17" | |
theme: theme-name | |
flags: --buildDrafts=false --noTimes | |
deploy: | |
steps: | |
- install-packages: | |
packages: openssh-client rsync | |
- add-to-known_hosts: | |
hostname: $HOSTNAME | |
- mktemp: | |
envvar: PRIVATEKEY_PATH | |
- create-file: | |
name: write key | |
filename: $PRIVATEKEY_PATH | |
content: $WERCKER_PRIVATE | |
overwrite: true | |
- script: | |
name: transfer blog | |
code: | | |
rsync -au -e "ssh -i $PRIVATEKEY_PATH -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress public/* root@$HOSTNAME:/var/www/blog | |
ssh -i $PRIVATEKEY_PATH -l root -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOSTNAME chown -R www-data:www-data /var/www/ | |
- script: | |
name: restart nginx | |
code: ssh -i $PRIVATEKEY_PATH -l root -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOSTNAME nginx -s reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment