Monorepo for Aesthetic.Computer aesthetic.computer
at main 57 lines 1.4 kB view raw
1#!/usr/bin/env fish 2# Deployment script for grab worker 3# Usage: ./deploy.fish [production] 4 5set -l ENV "dev" 6if test (count $argv) -gt 0 7 set ENV $argv[1] 8end 9 10echo "🚀 Deploying grab worker to $ENV..." 11 12# Ensure we're in the right directory 13cd (dirname (status -f)) 14cd .. 15 16# Type check 17echo "📝 Running type check..." 18npm run type-check 19if test $status -ne 0 20 echo "❌ Type check failed!" 21 exit 1 22end 23 24# Copy production config if deploying to production 25if test "$ENV" = "production" 26 echo "📋 Copying production config from vault..." 27 28 if test -f ../aesthetic-computer-vault/grab/wrangler.production.toml 29 cp ../aesthetic-computer-vault/grab/wrangler.production.toml ./wrangler.toml 30 echo "✅ Production config copied" 31 else 32 echo "❌ Production config not found in vault!" 33 exit 1 34 end 35end 36 37# Deploy 38echo "🚢 Deploying to Cloudflare..." 39npx wrangler deploy 40 41if test $status -eq 0 42 echo "✅ Deployment successful!" 43 44 if test "$ENV" = "production" 45 echo "" 46 echo "🌐 Worker deployed to: https://grab.aesthetic.computer" 47 echo "📊 View metrics: https://dash.cloudflare.com/" 48 echo "📝 View logs: npm run logs:production" 49 else 50 echo "" 51 echo "🌐 Worker deployed to dev" 52 echo "📝 View logs: npm run logs" 53 end 54else 55 echo "❌ Deployment failed!" 56 exit 1 57end