build.sh: only do ci tasks on main branch

This commit is contained in:
Starbeamrainbowlabs 2021-07-21 02:29:05 +01:00
parent 73e07eb013
commit 22c404b320
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,12 @@
#!/usr/bin/env bash
set -e;
current_branch="$(git rev-parse --abbrev-ref HEAD)";
if [[ "${1}" == "ci" ]] && [[ "${current_branch}" != "main" ]]; then
echo "Skipping build, because we are currently on the branch '${current_branch}', and we only deploy on the 'main' branch.";
fi
# ██████ ██ ██████ ██ ██ ██ ██ ██████
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
# ██ ██ ██████ ██ ██ ██ ██ ██ ██