2019-01-10 19:26:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
|
|
|
|
|
2019-01-11 15:19:29 +00:00
|
|
|
rm -rf public/*
|
|
|
|
|
2019-01-10 19:26:53 +00:00
|
|
|
# Build the project.
|
2019-01-11 15:19:29 +00:00
|
|
|
hugo # --cleanDestinationDir also removes .git :/ # if using a theme, replace with `hugo -t <YOURTHEME>`
|
2019-01-10 19:26:53 +00:00
|
|
|
|
|
|
|
# Go To Public folder
|
|
|
|
cd public
|
|
|
|
|
|
|
|
# Add changes to git.
|
|
|
|
git add .
|
|
|
|
|
|
|
|
# Commit changes.
|
|
|
|
msg="rebuilding site `date`"
|
|
|
|
if [ $# -eq 1 ]
|
|
|
|
then msg="$1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
git commit -m "$msg"
|
|
|
|
|
|
|
|
# Push source and build repos.
|
|
|
|
git push origin master
|
|
|
|
|
|
|
|
# Come Back up to the Project Root
|
|
|
|
cd ..
|
|
|
|
|