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

View file

@ -1,6 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e; 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
# ██████ ██ ██████ ██ ██ ██ ██ ██████ # ██████ ██ ██████ ██ ██ ██ ██ ██████
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ # ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
# ██ ██ ██████ ██ ██ ██ ██ ██ ██ # ██ ██ ██████ ██ ██ ██ ██ ██ ██