-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvercel-deploy.sh
More file actions
executable file
Β·43 lines (33 loc) Β· 1.25 KB
/
vercel-deploy.sh
File metadata and controls
executable file
Β·43 lines (33 loc) Β· 1.25 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
#!/bin/bash
# Code-Swarm Vercel Deployment Script
# Usage: ./vercel-deploy.sh [production|preview]
set -euo pipefail
ENVIRONMENT="${1:-preview}"
VERCEL_TOKEN="${VERCEL_TOKEN:-}"
if [ -z "$VERCEL_TOKEN" ]; then
echo "ERROR: VERCEL_TOKEN environment variable is required"
exit 1
fi
# Install Vercel CLI
echo "π¦ Installing Vercel CLI..."
npm install -g vercel@latest
# Pull environment information
echo "π Pulling environment information for $ENVIRONMENT..."
vercel pull --yes --environment=$ENVIRONMENT --token=$VERCEL_TOKEN
# Build project
echo "ποΈ Building project for $ENVIRONMENT..."
vercel build --$ENVIRONMENT --token=$VERCEL_TOKEN
# Deploy
echo "π Deploying to $ENVIRONMENT..."
DEPLOY_OUTPUT=$(vercel deploy --prebuilt --token=$VERCEL_TOKEN)
DEPLOY_URL=$(echo "$DEPLOY_OUTPUT" | grep -Eo 'https://[^ ]+')
echo "β
Deployment successful!"
echo "π URL: $DEPLOY_URL"
echo ""
echo "π Next steps:"
echo "1. Set environment variables in Vercel dashboard:"
echo " - SECRET_KEY (generate with: python -c \"import secrets; print(secrets.token_urlsafe(64))\")"
echo " - ALLOWED_ORIGINS (comma-separated list)"
echo " - ENVIRONMENT=$ENVIRONMENT"
echo "2. Configure custom domain if needed"
echo "3. Set up GitHub Actions for CI/CD (see SECURITY.md)"