Skip to content

Instantly share code, notes, and snippets.

Created March 31, 2018 20:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# GitHub A records
# rm -rf public
# git submodule add -b master layouts
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}')
printf $baseURL > docs/CNAME
msg="rebuilding site `date`"
if [ $# -eq 1 ]
then msg="$1"
# 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