diff options
| author | Joseph Elliott Hand <jhand@hawaii.edu> | 2026-07-19 21:46:16 -1000 |
|---|---|---|
| committer | Joseph Elliott Hand <jhand@hawaii.edu> | 2026-07-19 21:56:48 -1000 |
| commit | 650aef75480b773661e53a751337abef3b2abd47 (patch) | |
| tree | ae9250fc8a79a6c05298d045f591c2b8b540238b /deploy.sh | |
| download | josephhand.space-650aef75480b773661e53a751337abef3b2abd47.tar.gz | |
Initial commit
Signed-off-by: Joseph Elliott Hand <jhand@hawaii.edu>
Diffstat (limited to 'deploy.sh')
| -rwxr-xr-x | deploy.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..7d55636 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,24 @@ +#!/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/ |
