Created
January 6, 2015 05:19
-
-
Save JackNicholas/9ad3628d308983bf1560 to your computer and use it in GitHub Desktop.
deploy script for hugo blog to github user pages using two repos
This file contains 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
# 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