aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-12-23 00:24:49 +0100
committerNoah Loomans <noahloomans@gmail.com>2018-12-23 00:28:15 +0100
commit04ceec9604178482fd1642ceaea035608e730684 (patch)
treec7326aa9140aee36331120d20fa34463cd0709bf
parent8484592535779df9f889adc1a1a428723ea90b3e (diff)
Only deploy on master
-rw-r--r--.build.yml19
1 files changed, 13 insertions, 6 deletions
diff --git a/.build.yml b/.build.yml
index ffaa85a..a4ac63d 100644
--- a/.build.yml
+++ b/.build.yml
@@ -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