diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29..0000000 diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index f19f608..0000000 --- a/deploy.sh +++ /dev/null @@ -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 diff --git a/first-time-setup.sh b/first-time-setup.sh deleted file mode 100644 index c2bfaa2..0000000 --- a/first-time-setup.sh +++ /dev/null @@ -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