Context
In 2026 I designed and implemented the build-once, promote-everywhere setup for the learner web platform, as its architect.
The problem
Environment values were baked in at build time, so each environment needed its own build. Staging was never the same artefact as production. Config could also skew between the loader, the services and the pages.
What I did
I built a runtime-config resolver that reads environment settings from the cluster and exposes them to the page at load.
I made an immutable release manifest, with loader, i18n and widget artefacts keyed by commit SHA.
I reduced API hosts to a single base host.
I moved release triggers from GitHub Actions to Cloud Build.
I added a skew-safe overrides channel for previews, with the live-class app as its first user.
Key decision
I separated the build from the environment: one image, with config read at runtime, instead of one image per environment.
The cost is that config errors now show at runtime instead of build time. The immutable manifest limits the blast radius.
Result
One image promotes from dev to staging to production. Rollback is a pointer flip.
What I learned
I would keep the manifest immutable and SHA-keyed. I would add a startup check that fails fast when required runtime config is missing.
Stack
- Next.js
- Docker
- Kubernetes ConfigMaps
- Cloud Build
- TypeScript
