Spaces:
Runtime error
Runtime error
| echo "π Safe Deployment Script for Aether AIβ’" | |
| echo "==================================" | |
| # Set memory limits to prevent crashes | |
| export NODE_OPTIONS="--max-old-space-size=1024" | |
| # Check if we're in the right directory | |
| if [ ! -f "package.json" ]; then | |
| echo "β Error: Not in project directory. Run from project root." | |
| exit 1 | |
| fi | |
| # Step 1: Clean install (lighter) | |
| echo "π¦ Installing dependencies (production only)..." | |
| npm ci --only=production --silent | |
| # Step 2: Build with memory limits (safer) | |
| echo "ποΈ Building project with memory limits..." | |
| npm run build:safe | |
| if [ $? -ne 0 ]; then | |
| echo "β Build failed. Trying even safer build..." | |
| NODE_OPTIONS="--max-old-space-size=512" npm run build --no-lint | |
| if [ $? -ne 0 ]; then | |
| echo "β Build failed. System may need more memory. Try closing other apps." | |
| exit 1 | |
| fi | |
| fi | |
| # Step 3: Deploy to Vercel (safer) | |
| echo "π Deploying to Vercel..." | |
| npx vercel --prod --yes | |
| echo "β Deployment complete!" | |
| echo "π Next: Set up tunnel for backend at https://ngrok.com/" |