Runbook: Cloudflare Pages Git Provider Failover
- Last Updated
-
2026-02-13
- Owner
-
Evan Rosado
- Frequency
-
As Needed (GitHub outage)
Purpose
Deploy documentation sites to Cloudflare Pages when the primary git provider (GitHub) is unavailable. This runbook documents the multi-provider redundancy strategy and failover procedures.
Architecture
Prerequisites
-
wranglerCLI installed and authenticated -
Access to at least one working git remote
-
Local clone of repository
-
Cloudflare API token with Pages:Edit permission
# Verify wrangler authentication
wrangler whoami
# Verify git remotes
git remote -v
Procedure
Option 1: Wrangler Direct Deploy (Fastest)
Use when GitHub is down and you need to deploy immediately.
Step 1: Pull Latest from Working Remote
# Try GitLab first
git pull gitlab main
# Or use self-hosted Gitea
git pull gitea main
Option 2: Switch Pages to GitLab
Use for longer GitHub outages when you want automatic deployments.
Step 1: Access Cloudflare Dashboard
Navigate to: Cloudflare Dashboard → Pages → domus-docs → Settings → Builds & deployments
Option 3: Deploy All domus-* Sites
When multiple sites need updating during GitHub outage:
#!/bin/bash
# deploy-all-domus.sh
sites=(
"domus-docs:build/site"
"domus-captures:build/site"
)
for site_config in "${sites[@]}"; do
IFS=':' read -r project output_dir <<< "$site_config"
repo_path="$HOME/atelier/_bibliotheca/$project"
if [[ -d "$repo_path" ]]; then
echo "=== Deploying $project ==="
cd "$repo_path"
git pull gitlab main 2>/dev/null || git pull gitea main
make
wrangler pages deploy "$output_dir" --project-name="$project"
fi
done
Verification
Troubleshooting
Issue: Wrangler Authentication Failed
Symptom: Error: Authentication required
Cause: Wrangler token expired or not set
Resolution:
# Re-authenticate
wrangler login
# Or set token directly
export CLOUDFLARE_API_TOKEN="your-token"
Issue: Build Fails Locally
Symptom: Antora build errors
Cause: Missing dependencies or Kroki server not running
Resolution:
# Start Kroki
make kroki
# Reinstall dependencies
npm install
# Retry build
make
Issue: Cannot Pull from Any Remote
Symptom: All git pull commands fail
Cause: Network issues or all providers down (unlikely)
Resolution:
Deploy from existing local build (if recent):
# Check when build was last updated
ls -la build/site/index.html
# Deploy existing build
wrangler pages deploy build/site --project-name=domus-docs
Rollback
If a bad deployment was pushed:
# List recent deployments
wrangler pages deployment list --project-name=domus-docs
# Rollback to previous deployment (via dashboard)
# Cloudflare Dashboard → Pages → domus-docs → Deployments → [select previous] → "Rollback to this deployment"
Automation: domus-push-all Function
The domus-push zsh function pushes to all remotes for all domus-* repos:
# Push single repo to all remotes
gpall
# Push all domus-* repos to primary remote
domus-push
Location: ~/.zshrc
Industry Practice
This multi-provider strategy is standard practice:
| Organization | Strategy |
|---|---|
GitLab.com |
Mirrors to GitHub + self-hosted backup |
Kubernetes SIGs |
GitHub primary + GitLab mirrors |
Netflix |
Multi-region + multi-provider redundancy |
Cloudflare |
Recommends wrangler CLI as GitHub-down fallback |