Description
Give every pull request its own short-lived environment with GitHub Actions, Helm and Kubernetes, and delete it automatically when the PR closes.
Code review has a blind spot: we review diffs, but we ship running systems.
A reviewer reads 200 changed lines and approves. Nobody ran it. A config tweak, a migration or a changed API contract can all look fine in a diff and still break in a real environment.
The usual fix is a shared staging environment. That creates new problems:
Two PRs overwrite each other's changes.
"Who's using staging right now?" becomes a Slack ritual.
Bugs get found after merge, when they are most expensive to fix.
A better pattern is to give every pull request its own short-lived environment, then delete it when the PR closes.
The idea
When a PR opens or is updated:
Build the image, tagged with the commit SHA.
Deploy it to its own Kubernetes namespace, pr-.
Post the preview URL as a PR comment.
When the PR closes or merges:
Delete the namespace.…