deploy/entrypoint.sh

15 lines
601 B
Bash
Raw Permalink Normal View History

2024-04-27 08:58:57 +00:00
#!/bin/sh -l
2024-05-18 23:17:50 +00:00
LOCAL_PATH="$1"
DEPLOY_PATH="$2"
RESTART_NGINX="$3"
rsync -hrz --delete -C --exclude=".*" -e ssh "$LOCAL_PATH" "deploy.sixohthree.com:/tmp/gitea_${GITHUB_RUN_NUMBER}_${GITHUB_SHA}"
ssh deploy.sixohthree.com "dsh -M -c -r ssh -g webs -- rsync -hvrz --delete -C -e ssh deploy.sixohthree.com:/tmp/gitea_${GITHUB_RUN_NUMBER}_${GITHUB_SHA}/ $DEPLOY_PATH"
2024-04-27 09:35:35 +00:00
ssh deploy.sixohthree.com "rm -rf /tmp/gitea_${GITHUB_RUN_NUMBER}_${GITHUB_SHA}"
2024-05-18 23:45:04 +00:00
if [ "$RESTART_NGINX" = "yes" ]; then
2024-05-18 23:49:19 +00:00
echo "Restarting nginx..."
ssh deploy.sixohthree.com "dsh -M -c -r ssh -g webs -- sudo systemctl reload nginx"
fi