Files
blackroad-infra/scripts/deploy/deploy-cloudflare-worker.sh
Alexa Amundson d34d588dd0 Sync 134 infrastructure scripts and dashboard from local
94 deployment scripts, 32 setup scripts, 8 operational utilities
(cloudflare, docker, k3s, railway, tailscale, ssh, dns, network),
and Next.js infrastructure dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 01:12:37 -06:00

43 lines
1.2 KiB
Bash

#!/usr/bin/env bash
# Deploy Cloudflare Worker for BlackRoad
echo "🚀 Deploying BlackRoad Cloudflare Worker"
echo ""
# Check if wrangler is installed
if ! command -v wrangler &>/dev/null; then
echo "📦 Installing wrangler..."
npm install -g wrangler
fi
# Check auth
echo "🔐 Checking Cloudflare authentication..."
if ! wrangler whoami &>/dev/null; then
echo "⚠️ Not logged in. Running: wrangler login"
wrangler login
fi
# Deploy worker
echo "📤 Deploying worker..."
cd ~
if wrangler deploy blackroad-deploy-worker.js --name blackroad-deploy-dispatcher; then
echo ""
echo "✅ Worker deployed successfully!"
echo ""
echo "🌐 Your worker URL will be shown above"
echo ""
echo "Next steps:"
echo " 1. Copy the worker URL"
echo " 2. Go to GitHub repo settings → Webhooks"
echo " 3. Add webhook with URL: https://blackroad-deploy-dispatcher.YOUR_SUBDOMAIN.workers.dev/webhook/github"
echo " 4. Set Content type: application/json"
echo " 5. Select: Just the push event"
else
echo "❌ Deployment failed"
echo ""
echo "Manual deployment:"
echo " 1. wrangler login"
echo " 2. wrangler deploy ~/blackroad-deploy-worker.js --name blackroad-deploy-dispatcher"
fi