From 0e0d336d7ec80ff00e0e4d9acf00267ad3faa214 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Thu, 7 May 2026 16:04:43 +0800 Subject: Deployment script and replace regex search with SA search. --- deploy.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 deploy.sh (limited to 'deploy.sh') diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..8f7fa52 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,29 @@ +#!/bin/ksh + +set -e + +if [ -f .env ]; then + . ./.env +else + echo ".env file not found" + exit 1 +fi + +SSH_CMD="ssh -t -i $SSH_KEY $SERVER_USER@$SERVER_IP" + +echo "Building Jekyll site..." +JEKYLL_ENV=production bundle exec jekyll build + +echo "Running indexer..." +(cd cgi-bin && perl indexer.pl) + +echo "Running remote presh..." +$SSH_CMD "doas $REMOTE_PATH/presh" + +echo "Syncing files..." +rsync --rsync-path=openrsync -a --delete -e "ssh -i $SSH_KEY" $HOME/www/_site/ $SERVER_USER@$SERVER_IP:$REMOTE_PATH/$SITE + +echo "Running remote sh..." +$SSH_CMD "doas $REMOTE_PATH/sh" + +echo "Deployment complete" -- cgit v1.2.3