Skip to content

Instantly share code, notes, and snippets.

@jdheyburn
Created December 11, 2019 19:34
Show Gist options
  • Save jdheyburn/e84bab9176dc1753416637324a04603d to your computer and use it in GitHub Desktop.
Save jdheyburn/e84bab9176dc1753416637324a04603d to your computer and use it in GitHub Desktop.
#!/bin/bash
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
# Build the project.
hugo # if using a theme, replace with `hugo -t <YOURTHEME>`
# Copy CNAME to public
cp CNAME ./public/
# 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 ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment