diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-12-23 00:24:49 +0100 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-12-23 00:28:15 +0100 |
commit | 04ceec9604178482fd1642ceaea035608e730684 (patch) | |
tree | c7326aa9140aee36331120d20fa34463cd0709bf | |
parent | 8484592535779df9f889adc1a1a428723ea90b3e (diff) |
Only deploy on master
-rw-r--r-- | .build.yml | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -12,9 +12,16 @@ tasks: cd noahloomans.com jekyll build - deploy: | - rsync \ - --rsh='ssh -o StrictHostKeyChecking=no' \ - --delete \ - --recursive \ - --progress \ - noahloomans.com/_site/. $deploy:/var/www/noahloomans.com/html/ + cd noahloomans.com + # We only want to deploy when on master. We cain't just check if + # --abbrev-ref is master since the HEAD is detached. + if [ "$(git rev-parse master)" = "$(git rev-parse HEAD)" ]; then + rsync \ + --rsh='ssh -o StrictHostKeyChecking=no' \ + --delete \ + --recursive \ + --progress \ + _site/. $deploy:/var/www/noahloomans.com/html/ + else + echo "Not on master, skipping..." + fi |