-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·42 lines (33 loc) · 891 Bytes
/
deploy.sh
File metadata and controls
executable file
·42 lines (33 loc) · 891 Bytes
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
#!/bin/bash
# Ensure script exits on error
set -e
echo "Starting deployment to Vercel..."
# Install Vercel CLI if not installed
if ! command -v vercel &> /dev/null; then
echo "Installing Vercel CLI..."
npm install -g vercel
fi
# Check if user is logged in to Vercel
echo "Checking Vercel login status..."
if ! vercel whoami &> /dev/null; then
echo "Please login to Vercel:"
vercel login
fi
# Verify the API directory structure
echo "Verifying API structure..."
if [ ! -d "api" ]; then
echo "Error: 'api' directory not found in the root of the project."
exit 1
fi
if [ ! -f "api/index.py" ]; then
echo "Error: 'api/index.py' file not found."
exit 1
fi
# Run the local build script
echo "Running local build process..."
chmod +x build-local.sh
./build-local.sh
# Deploy to Vercel
echo "Deploying to Vercel..."
vercel --prod
echo "Deployment complete!"