From a45001a75f185cd3c5b1dd4a65a7341f2f8e8cfc Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 14 Apr 2019 21:41:04 +0100 Subject: [PATCH] Only deploy on the master branch --- build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build b/build index 648f41c..5915499 100755 --- a/build +++ b/build @@ -272,7 +272,10 @@ task_ci() { tasks_run setup setup-dev NODE_ENV="production" tasks_run client docs archive; - if [ "${GIT_REF_NAME}" == "refs/heads/master" ]; then + latest_commit="$(git log -n 1 --pretty=format:"%H")"; + current_commit="$(git rev-parse HEAD)"; + + if [ "${GIT_REF_NAME}" == "refs/heads/master" ] && [ "${latest_commit}" == "${current_commit}" ]; then tasks_run deploy; else echo "Not deploying, as this build wasn't on the master branch.";