mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-02-07 12:19:36 +00:00
Update the shell scripts
This commit is contained in:
parent
4088b6e15a
commit
b7bba50a0d
@ -8,7 +8,7 @@ green="\u001b[32m"
|
|||||||
reset="\u001b[0m"
|
reset="\u001b[0m"
|
||||||
|
|
||||||
error_log() {
|
error_log() {
|
||||||
printf "$red An error occurred on line $1\n"
|
printf "$red An error occurred on line $1\n $reset"
|
||||||
}
|
}
|
||||||
|
|
||||||
target_branch="gh-pages"
|
target_branch="gh-pages"
|
||||||
@ -26,6 +26,11 @@ mkdir $build_directory
|
|||||||
git worktree prune
|
git worktree prune
|
||||||
rm -rf .git/worktrees/$build_directory
|
rm -rf .git/worktrees/$build_directory
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
# Building the site
|
# Building the site
|
||||||
printf "Building the site"
|
printf "Building the site"
|
||||||
hugo
|
hugo
|
||||||
@ -36,4 +41,4 @@ cd $build_directory
|
|||||||
git add --all
|
git add --all
|
||||||
git commit -m "Deploying site to branch $target_branch."
|
git commit -m "Deploying site to branch $target_branch."
|
||||||
|
|
||||||
git push $main_remote_alias $target_branch
|
git push --force $main_remote_alias $target_branch
|
||||||
|
@ -30,7 +30,7 @@ git reset --hard
|
|||||||
git commit --allow-empty -m "Initializing $target_branch branch"
|
git commit --allow-empty -m "Initializing $target_branch branch"
|
||||||
|
|
||||||
# Pushing the branch into origin
|
# Pushing the branch into origin
|
||||||
git push $main_remote_alias $target_branch
|
git push --force $main_remote_alias $target_branch
|
||||||
git checkout $default_branch
|
git checkout $default_branch
|
||||||
|
|
||||||
# Cleaning up the build site first
|
# Cleaning up the build site first
|
||||||
|
Loading…
Reference in New Issue
Block a user