From 04ceec9604178482fd1642ceaea035608e730684 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Sun, 23 Dec 2018 00:24:49 +0100 Subject: Only deploy on master --- .build.yml | 19 +++++++++++++------ 1 file 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 -- cgit v1.1