#!/bin/sh if [ ! -f hugo.toml ]; then echo "Must be run in hugo base directory... Exiting." exit 1 fi if [ "$(git status --porcelain | wc -l)" -gt 0 ]; then echo "There are uncommited changes... Exiting." exit 1 fi if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then echo "Not on branch master... Exiting." exit 1 fi if [ -d public/ ]; then echo "Cleaning old build." rm -r public/ fi echo "Deploying site..." hugo && rsync -avz --delete --exclude=git/ public/ www@josephhand.space:/srv/html/josephhand.space/