From 3edaf126dcc553614fa7553fcba33c10054dcab5 Mon Sep 17 00:00:00 2001 From: David Thurstenson Date: Mon, 4 Oct 2021 20:54:10 -0500 Subject: [PATCH] Move hosting to new vps setup, and add deploy script --- .gitignore | 1 + deploy | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100755 deploy diff --git a/.gitignore b/.gitignore index c28483c..4ff0f53 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ public/** +deploy_id diff --git a/deploy b/deploy new file mode 100755 index 0000000..e072302 --- /dev/null +++ b/deploy @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# To auto-deploy this on git push, add a symlink at .git/hooks/pre-push that points to this script +# Example: ln -s ../../deploy .git/hooks/pre-push + +# Get the dir of the running script +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + +# Pull variables in from deploy_id +source "$SCRIPT_DIR/deploy_id" + +# Generate and push the output to the server +hugo && rsync -avz --delete public/ ${USER}@${HOST}:${DIR}