Simplify: Just build frontend, manual deployment
All checks were successful
Build Frontend / Build Frontend (push) Successful in 7s

This commit is contained in:
2026-01-11 00:45:18 +00:00
parent 64f2dd853e
commit 72e04a6258

View File

@@ -1,4 +1,4 @@
name: Deploy to Production
name: Build Frontend
on:
push:
@@ -6,8 +6,8 @@ on:
- main
jobs:
deploy:
name: Deploy to turbotrades.dev
build:
name: Build Frontend
runs-on: Turbo-Dev
steps:
@@ -19,9 +19,6 @@ jobs:
with:
node-version: "24"
- name: Install Backend Dependencies
run: npm install --production
- name: Install Frontend Dependencies
run: |
cd frontend
@@ -36,77 +33,8 @@ jobs:
VITE_API_URL: https://api.turbotrades.dev
VITE_WS_URL: https://ws.turbotrades.dev
- name: Install SSH Client
- name: Success
run: |
sudo apt-get update
sudo apt-get install -y sshpass rsync
- name: Deploy to Server
env:
SERVER_HOST: ${{ secrets.SERVER_HOST }}
SERVER_USER: ${{ secrets.SERVER_USER }}
SERVER_PASSWORD: ${{ secrets.SERVER_PASSWORD }}
run: |
echo "🚀 Starting deployment..."
# Deploy files via rsync
echo "📦 Syncing backend files..."
sshpass -p "$SERVER_PASSWORD" rsync -avz --delete \
--exclude 'node_modules' \
--exclude '.git' \
--exclude '.env' \
--exclude 'logs' \
-e "ssh -o StrictHostKeyChecking=no -p 22" \
./ ${SERVER_USER}@${SERVER_HOST}:/root/ttbackend/
echo "🎨 Syncing frontend build..."
sshpass -p "$SERVER_PASSWORD" rsync -avz --delete \
-e "ssh -o StrictHostKeyChecking=no -p 22" \
./frontend/dist/ ${SERVER_USER}@${SERVER_HOST}:/var/www/html/turbotrades/
echo "▶️ Running deployment commands on server..."
sshpass -p "$SERVER_PASSWORD" ssh -o StrictHostKeyChecking=no -p 22 ${SERVER_USER}@${SERVER_HOST} bash << 'EOF'
cd /root/ttbackend
# Install backend dependencies
echo "📦 Installing backend dependencies..."
npm install --production
# Set frontend permissions
echo "🔒 Setting frontend permissions..."
chown -R www-data:www-data /var/www/html/turbotrades
chmod -R 755 /var/www/html/turbotrades
# Restart backend with PM2
echo "🔄 Restarting backend..."
pm2 restart turbotrades-backend 2>/dev/null || pm2 start ecosystem.config.js --env production
pm2 save
echo "✅ Deployment complete!"
pm2 list
EOF
- name: Health Check
run: |
echo "⏳ Waiting for services to start..."
sleep 10
echo "🏥 Checking backend..."
curl -f https://api.turbotrades.dev/api/health || echo "⚠️ Backend check failed"
echo "🏥 Checking frontend..."
curl -f https://turbotrades.dev || echo "⚠️ Frontend check failed"
- name: Notify Success
if: success()
run: |
echo "✅ Deployment successful!"
echo "🌐 Frontend: https://turbotrades.dev"
echo "🔧 Backend: https://api.turbotrades.dev"
echo "💬 WebSocket: https://ws.turbotrades.dev"
- name: Notify Failure
if: failure()
run: |
echo "❌ Deployment failed!"
echo "Check the logs above for details"
echo "✅ Frontend built successfully!"
echo "📦 Build output: frontend/dist/"
echo "🎨 Ready for manual deployment"