1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#!/bin/bash
echo -e "\\033[0;32mDeploying updates to GitHub...\\033[0m"
# Build the project.
hugo -t minimal # if using a theme, replace with `hugo -t <YOURTHEME>`
# Go To Public folder
mkdir -p public && cd public || exit
# 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 ..