-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·42 lines (35 loc) · 1.4 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·42 lines (35 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
# Deploy Tyrnhaw 2026 website via rsync
# Usage: ./deploy.sh
set -euo pipefail
# ─── Configuration ───────────────────────────────────────────
DEPLOY_HOST="${DEPLOY_HOST:-longsword.academy}"
DEPLOY_USER="${DEPLOY_USER:-anton}"
DEPLOY_PATH="${DEPLOY_PATH:-/var/www/html}"
DEPLOY_SSH_KEY="${DEPLOY_SSH_KEY:-}"
SSH_OPTS="-o StrictHostKeyChecking=accept-new"
if [[ -n "$DEPLOY_SSH_KEY" ]]; then
SSH_OPTS="$SSH_OPTS -i $DEPLOY_SSH_KEY"
fi
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# ─── Deploy ──────────────────────────────────────────────────
echo "Deploying to ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}"
rsync -avz \
--exclude='.git' \
--exclude='.github' \
--exclude='.claude' \
--exclude='.gitignore' \
--exclude='.playwright-mcp' \
--exclude='CLAUDE.md' \
--exclude='deploy.sh' \
--exclude='deploy.env' \
--include='img/' \
--include='img/*' \
--exclude='*.original.*' \
--exclude='*.png' \
--exclude='.DS_Store' \
-e "ssh $SSH_OPTS" \
"$SCRIPT_DIR/" \
"${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/" \
|| { rc=$?; [[ $rc -eq 23 ]] && echo "Warning: some timestamps could not be set (harmless)" || exit $rc; }
echo "Done. Site deployed to https://tyrnhaw.tsc.sk"