mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-01-31 04:58:26 +00:00
Revise deploy script
This commit is contained in:
parent
3a819b916b
commit
9d85e9c106
12
deploy.sh
12
deploy.sh
@ -20,16 +20,18 @@ trap 'error_log $LINENO' ERR
|
||||
|
||||
# Cleaning up the build site
|
||||
printf "Deleting older version of the site"
|
||||
rm -rf $build_directory
|
||||
mkdir $build_directory
|
||||
|
||||
git worktree remove $build_directory --force
|
||||
git worktree prune
|
||||
rm -rf .git/worktrees/$build_directory
|
||||
git branch -D $target_branch
|
||||
|
||||
# Building the worktree for the target branch
|
||||
# https://git-scm.com/docs/git-worktree
|
||||
echo "Checking out $target_branch branch into public"
|
||||
git worktree add -B $target_branch $public $main_remote_alias/$target_branch
|
||||
git checkout --orphan $target_branch
|
||||
git reset --hard
|
||||
git commit --allow-empty -m "Initialize $target_branch branch."
|
||||
git checkout $default_branch
|
||||
git worktree add $build_directory $target_branch
|
||||
|
||||
# Building the site
|
||||
printf "Building the site"
|
||||
|
Loading…
Reference in New Issue
Block a user