Switch to SSH key authentication
All checks were successful
Build Frontend / Build Frontend (push) Successful in 20s

This commit is contained in:
2026-01-11 00:51:10 +00:00
parent 3cc774ed05
commit c35a36b85a

View File

@@ -38,31 +38,28 @@ jobs:
- name: Deploy to Server
run: |
# Hardcoded credentials (replace these values)
SERVER_HOST="your.server.host"
# SSH Key Configuration (update path to your key)
SERVER_HOST="turbotrades.dev"
SERVER_USER="root"
SERVER_PASSWORD="your_password"
SSH_KEY="$HOME/.ssh/gitea_deploy"
SERVER_PORT="22"
echo "🚀 Deploying to server..."
# Install sshpass
sudo apt-get update && sudo apt-get install -y sshpass rsync
# Sync backend files
echo "📦 Syncing backend..."
sshpass -p "$SERVER_PASSWORD" rsync -avz --delete \
rsync -avz --delete \
--exclude 'node_modules' \
--exclude '.git' \
--exclude 'frontend/node_modules' \
--exclude 'frontend/dist' \
-e "ssh -o StrictHostKeyChecking=no -p $SERVER_PORT" \
-e "ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p $SERVER_PORT" \
./ ${SERVER_USER}@${SERVER_HOST}:/root/ttbackend/
# Sync frontend build
echo "🎨 Syncing frontend..."
sshpass -p "$SERVER_PASSWORD" rsync -avz --delete \
-e "ssh -o StrictHostKeyChecking=no -p $SERVER_PORT" \
rsync -avz --delete \
-e "ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p $SERVER_PORT" \
./frontend/dist/ ${SERVER_USER}@${SERVER_HOST}:/var/www/html/turbotrades/
echo "✅ Deployment complete!"