Skip to content

Commit

Permalink
Github action: add deploy workflow (alshedivat#163)
Browse files Browse the repository at this point in the history
* Github action: add deploy workflow

* Update .github/workflows/deploy.yml

Co-authored-by: Maruan <[email protected]>
  • Loading branch information
2 people authored and siantonelli committed Oct 26, 2024
1 parent 0557bf9 commit 42f7f09
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions bin/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ while [[ $# > 0 ]]; do
-u|--user)
SRC_BRANCH="source"
DEPLOY_BRANCH="master"
shift
;;
-s|--src)
SRC_BRANCH="$2"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 42f7f09

Please sign in to comment.