From 42f7f0971fcf94c77a2fe030ca626577a90ebfd1 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Mon, 4 Jan 2021 18:09:20 -0700 Subject: [PATCH] Github action: add deploy workflow (#163) * Github action: add deploy workflow * Update .github/workflows/deploy.yml Co-authored-by: Maruan --- bin/deploy | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/deploy b/bin/deploy index 56163b8714a1..d6440252a86e 100755 --- a/bin/deploy +++ b/bin/deploy @@ -138,7 +138,6 @@ while [[ $# > 0 ]]; do -u|--user) SRC_BRANCH="source" DEPLOY_BRANCH="master" - shift ;; -s|--src) SRC_BRANCH="$2" @@ -148,10 +147,16 @@ while [[ $# > 0 ]]; do DEPLOY_BRANCH="$2" shift ;; + --verbose) + set -x + ;; + --dry-run) + DRY_RUN="--dry-run" + ;; *) - echo "Option $1 is unknown." - echo $USAGE_MSG - exit 0 + echo "Option $1 is unknown." >&2 + echo $USAGE_MSG >&2 + exit 1 ;; esac shift @@ -206,7 +211,7 @@ rm -R _site/ # Push to DEPLOY_BRANCH git add -fA git commit --allow-empty -m "$(git log -1 --pretty=%B) [ci skip]" -git push -f -q origin $DEPLOY_BRANCH +git push ${DRY_RUN} -f -q origin $DEPLOY_BRANCH # Move back to SRC_BRANCH git checkout $SRC_BRANCH