-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·35 lines (26 loc) · 1.11 KB
/
deploy.sh
File metadata and controls
executable file
·35 lines (26 loc) · 1.11 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
#!/bin/bash
set -e
# --- Config ---
REMOTE_HOST="192.168.2.124"
REMOTE_PORT="2222"
REMOTE_USER="cburns"
REMOTE_DOCKER_PATH="/home/cburns/docker/chess"
FRONTEND_IMAGE="ghcr.io/burnsco/chess-frontend:latest"
BACKEND_IMAGE="ghcr.io/burnsco/chess-backend:latest"
echo "🚀 Starting local build for Chess..."
# --- Build Frontend ---
echo "📦 Building Frontend..."
docker build --network=host --target production -t "$FRONTEND_IMAGE" ./frontend
# --- Build Backend ---
echo "📦 Building Backend..."
docker build --network=host --target production -t "$BACKEND_IMAGE" ./backend
# --- Push to GHCR (Optional but recommended for consistency) ---
echo "⬆️ Pushing images to GHCR..."
docker push "$FRONTEND_IMAGE"
docker push "$BACKEND_IMAGE"
# --- Deploy to Server ---
echo "🚢 Deploying to $REMOTE_HOST..."
# 1. Update the local compose.yml to the remote path if needed, or just trigger pull
# Since the server already has compose.yml, we just tell it to pull and restart.
ssh -p "$REMOTE_PORT" "$REMOTE_USER@$REMOTE_HOST" "cd $REMOTE_DOCKER_PATH && docker compose pull && docker compose up -d"
echo "✅ Deployment complete!"