Delete unnecessary files

This commit is contained in:
foo-dogsquared 2019-09-05 20:25:07 +08:00
parent 43a5d44c6a
commit e6fb2354b9
3 changed files with 0 additions and 86 deletions

0
.gitmodules vendored
View File

View File

@ -1,46 +0,0 @@
#!/bin/bash
# Deploys the Hugo build into GitHub Pages.
# ANSI color codes
red="\u001b[31m"
green="\u001b[32m"
reset="\u001b[0m"
error_log() {
printf "$red An error occurred on line $1\n $reset"
}
target_branch="gh-pages"
default_branch="master"
main_remote_alias="origin"
build_directory="public/"
trap 'error_log $LINENO' ERR
# Cleaning up the build site
printf "Deleting older version of the site"
git worktree remove $build_directory --force
git worktree prune
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 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"
hugo
# Pushing the build into the pages branch
printf "$green -> Deploying page to GitHub...$reset\n"
cd $build_directory
git add --all
git commit -m "Deploying site to branch $target_branch."
git push --force $main_remote_alias $target_branch

View File

@ -1,40 +0,0 @@
#!/bin/bash
# Deploys the Hugo build into GitHub Pages.
# ANSI color codes
red="\u001b[31m"
green="\u001b[32m"
reset="\u001b[0m"
error_log() {
printf "$red An error occurred on line $1.\n"
}
target_branch="gh-pages"
default_branch="master"
main_remote_alias="origin"
build_directory="public/"
printf "$green -> Setting up first time things...$reset\n"
trap 'error_log $LINENO' ERR
# Creating orphan branch for the site
git checkout --orphan $target_branch
# Reset the branch while retaining the files
git reset --hard
# Initialize the branch
git commit --allow-empty -m "Initializing $target_branch branch"
# Pushing the branch into origin
git push --force $main_remote_alias $target_branch
git checkout $default_branch
# Cleaning up the build site first
rm -rf $build_directory
# Adding a worktree for the target branch and setting it to origin
git worktree add -B $target_branch $build_directory $main_remote_alias/$target_branch