← All work

Delivery engineering · Python · GitHub Actions · AWS Lambda

Shipping the same site to two CDNs

I wanted this site to stay up if a hosting provider went down. GitHub Actions publishes the same static files to Netlify and Bunny, and a separate monitor checks each one and switches DNS if the primary stays unhealthy. Copying the files turned out to be the easy part.

Delivery and recovery are separate operations
  1. GitHub Actions
    checks and static artifacts
  2. Netlify + Bunny
    independent copies
  3. Lambda probes
    real hostname and TLS
  4. Bunny DNS + Route 53
    shared routing decision

The monitor runs every minute. It switches after three failed checks, and only to a healthy standby. Switching back waits for ten healthy minutes.

What I’m responsible for

All of it is in the public website repository: the deploy scripts, provider settings, the monitor, certificate renewal and the checks. AI coding agents wrote much of the implementation and tests. I set the constraints and review what actually runs.

The standby has its own storage, and neither CDN proxies the other. Certificates renew on their own schedule, whichever CDN is serving traffic.

Same files, broken modules

The browser demos loaded fine from Netlify and failed on the standby. Bunny Storage was serving .mjs files as application/octet-stream, and browsers won’t run a module with that content type.

I added a Bunny edge rule that serves them as text/javascript and wrote it into the deployment instructions. After every deploy, a read-only check fetches a module from each provider and checks its content type.

Deployment note documenting the MIME rule

The redesign that switched off failover

The monitor counted a CDN as healthy if the homepage contained the phrase “Useful projects.” Then I redesigned the homepage and the phrase went away. Both copies were fine, the monitor decided both were down, and failover could no longer act. I changed the marker to the page title.

The fix and write-up. Before each deploy, a test now checks the real homepage against what the monitor expects, so a copy change that would break it fails first. It’s still a coupling: if the title changes, the monitor has to change with it.

The failover drill

The October 22 drill simulated a primary failure. The monitor moved the real DNS record to Bunny, and the site served from there over HTTPS. Normal monitoring kept traffic on the backup through the recovery period, then moved it back to Netlify. The drill also compared hashes of eight public files on both providers, and they matched.

Drill record · Routing tests. It was a simulated failure. A real provider outage hasn’t tested it yet.

Run the checks

git clone https://github.com/anthony-firn/evolvetech.dev
cd evolvetech.dev
python3 tools/verify_portfolio.py

# Optional: read-only HTTPS probes, no provider credentials
python3 tools/check_delivery.py --live

The first command runs the local checks: links and metadata, the routing logic, the homepage marker, the module content type and the campaign replay. The second probes both CDNs directly (hostname, certificate, homepage, health file and one module) and never touches DNS.

Delivery checks · Deployment workflow

What this doesn’t show

I don’t have an uptime number to give you. Failover still depends on resolvers honoring the 60-second TTL, on the schedulers actually running and on Bunny’s API being reachable. The live probe covers a few representative paths, not every file or region. Timings in the check record are from a local run, not CI.

For another backend change you can read, Evolve Inbox now has an optional PostgreSQL backend, tested with concurrent deliveries and an interrupted transaction.

Built with AI coding agents, which wrote most of the code and tests. How I work →

Status
Live; failover drill run October 22, 2026
License
Apache 2.0
Built with
Python, GitHub Actions, AWS Lambda, Netlify, Bunny CDN, Route 53