Deploying the Web App (dummy)
The web app is a static build served from a CDN. There is no server to SSH into.
Pipeline
- A pull request is opened.
- CI runs tests, type checks, and a preview build.
- On merge to
main, CI builds the production bundle and uploads it to object storage. - A short invalidation runs against the CDN.
- The new version is live within a minute or two.
Caching
- HTML: short cache, must-revalidate. We want users to get the latest shell quickly.
- Hashed assets (JS, CSS, images): one year, immutable. The hash in the filename is the cache key.
Rollbacks
Every deploy is a folder in object storage tagged with a short git SHA. Rolling back is a one-line change in the CDN origin config, pointing it at the previous folder. No rebuild required.
What not to do
- Don’t mutate files in the live bucket.
- Don’t skip CI for “urgent” changes. Urgency is exactly when we need the checks.