From 72e04a62581431b33bad048e7501e3f9c30308dc Mon Sep 17 00:00:00 2001 From: iDefineHD Date: Sun, 11 Jan 2026 00:45:18 +0000 Subject: [PATCH] Simplify: Just build frontend, manual deployment --- .gitea/workflows/deploy.yml | 86 +++---------------------------------- 1 file changed, 7 insertions(+), 79 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index a9ca7df..b28f7c6 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -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"