-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
34 lines (26 loc) · 1.01 KB
/
deploy.sh
File metadata and controls
34 lines (26 loc) · 1.01 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
#!/bin/bash
# ChittyAssets Cloudflare Deployment Script
echo "🚀 Deploying ChittyAssets to Cloudflare..."
# Check if authenticated
if ! wrangler whoami > /dev/null 2>&1; then
echo "❌ Not authenticated with Cloudflare"
echo "Please run: wrangler auth login"
echo "Or set CLOUDFLARE_API_TOKEN environment variable"
exit 1
fi
# Build the application
echo "🔨 Building application..."
npm run build
# Copy Cloudflare configuration files
echo "📁 Copying configuration files..."
cp _headers dist/public/
cp _redirects dist/public/
# Deploy frontend to Cloudflare Pages
echo "🌐 Deploying frontend to Cloudflare Pages..."
wrangler pages deploy dist/public --project-name chittyassets --compatibility-date 2024-01-01
# Deploy backend API as Cloudflare Worker
echo "⚡ Deploying backend API as Cloudflare Worker..."
wrangler deploy --name chittyassets-api
echo "✅ Deployment complete!"
echo "Frontend: https://chittyassets.pages.dev"
echo "Backend API: https://chittyassets-api.your-subdomain.workers.dev"