-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·50 lines (41 loc) · 1.26 KB
/
deploy.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.26 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
43
44
45
46
47
48
49
50
#!/bin/bash
echo "🚀 Starting deployment process..."
# Check if git is clean
if [ -n "$(git status --porcelain)" ]; then
echo "❌ Git working directory is not clean. Please commit or stash your changes."
exit 1
fi
echo "✅ Git working directory is clean"
# Build the frontend
echo "🔨 Building frontend..."
npm run build
if [ $? -ne 0 ]; then
echo "❌ Frontend build failed"
exit 1
fi
echo "✅ Frontend built successfully"
# Push to GitHub (this will trigger Vercel deployment)
echo "📤 Pushing to GitHub..."
git push origin main
if [ $? -ne 0 ]; then
echo "❌ Git push failed"
exit 1
fi
echo "✅ Code pushed to GitHub"
echo "🌐 Vercel will automatically deploy your frontend"
echo ""
echo "📋 Next steps:"
echo "1. Deploy backend to Railway:"
echo " - Go to https://railway.app"
echo " - Connect your GitHub repo"
echo " - Set environment variables:"
echo " MONGODB_URI=your_mongodb_atlas_connection_string"
echo " JWT_SECRET=your_super_secret_jwt_key"
echo " NODE_ENV=production"
echo " FRONTEND_URL=https://your-app.vercel.app"
echo ""
echo "2. Update frontend environment:"
echo " - Set NEXT_PUBLIC_API_URL to your Railway backend URL"
echo " - Redeploy on Vercel"
echo ""
echo "🎉 Deployment process completed!"