Created
March 31, 2018 21:51
-
-
Save InTEGr8or/6f81fe171b0fb01a6b6492128147c3b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub A records | |
# 192.30.252.153 | |
# 192.30.252.154 | |
#!/bin/bash | |
#* | |
# rm -rf public | |
# git submodule add -b master [email protected]:InTEGr8or/hugo_blackplain_theme.git layouts | |
# git clone https://gist.github.com/aad5b14b17276e803d352898a6c88c5b.git tmp | |
# mv hugo_deploy.sh . | |
# rm -rf tmp/ | |
printf "\033[0;32mDeploying updates to GitHub...\033[0m" | |
printf "Build the project." | |
rmdir docs/** -r | |
rm -rf docs/** | |
printf "Building Hugo" | |
hugo # if using a theme, replace with `hugo -t <YOURTHEME>` | |
baseURL=$(cat config.toml | grep baseURL | awk '{print $3}' | tr -d \") | |
printf $baseURL > docs/CNAME | |
msg="rebuilding site `date`" | |
if [ $# -eq 1 ] | |
then msg="$1" | |
fi | |
# Go To layouts/ | |
cd layouts | |
git add . | |
git commit -m "$msg" | |
git pull | |
git push | |
# return to parent folder | |
cd .. | |
# Add changes to git. | |
git add . | |
# Commit changes. | |
git commit -m "$msg" | |
git pull | |
# Push source and build repos. | |
git push # origin master -f | |
# Come Back up to the Project Root | |
# cd .. | |
printf "Task complete. You may close this window..." | |
# read | |
# open $baseURL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment