You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
balkian.github.com/deploy.sh

30 lines
486 B
Bash

#!/bin/bash
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
rm -rf public/*
# Build the project.
hugo # --cleanDestinationDir also removes .git :/ # if using a theme, replace with `hugo -t <YOURTHEME>`
# 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 ..