Skip to content

Instantly share code, notes, and snippets.

@JackNicholas
Created January 6, 2015 05:19
Show Gist options
  • Save JackNicholas/9ad3628d308983bf1560 to your computer and use it in GitHub Desktop.
Save JackNicholas/9ad3628d308983bf1560 to your computer and use it in GitHub Desktop.
deploy script for hugo blog to github user pages using two repos
# based on script at <http://gohugo.io/tutorials/github_pages_blog/>
echo -e "\033[1mDeploying updates to username.github.io...\033[0m"
# go to project folder
cd ~/path/
# build the project.
hugo
# go To public folder
cd public
# add changes to git.
git add --all
# commit changes.
msg="rebuilding site `date`"
if [ $# -eq 1 ]
then msg="$1"
fi
git ci --all -m "$msg"
# deploy
git push origin master
# come back
cd ..
echo -e "\033[1mDeploying updates to github.com/username/hugo-repos...\033[0m"
# add changes to git.
git add --all
# commit changes.
msg="rebuilding site `date`"
if [ $# -eq 1 ]
then msg="$1"
fi
git ci --all -m "$msg"
# deploy
git push origin master
echo -e "\033[1mDeploy complete\033[0m"
git log --oneline -4
git st
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment