CI/CD & GitHub Actions (50 Qs)•Part 3: Enterprise Scale, Compliance & Production Hardening (Senior / Staff)
Ephemeral Test Environments (Preview Environments / PR Environments) orchestration in CI/CD.
senior LevelMost AskedCI/CD & DevOps
In Simple Words: Ephemeral environments spin up an isolated, production-like copy of the frontend and microservices for each pull request. When the PR is closed or merged, the pipeline automatically destroys the infrastructure to eliminate cloud waste.
Workflow Stages:
- PR Opened/Updated:
- Build container image tagged with PR commit SHA.
- Deploy Kubernetes Namespace (
pr-${{ github.event.number }}) or Cloudflare Pages preview. - Comment URL on the PR discussion thread via GitHub API.
- PR Closed:
- Trigger cleanup workflow listening to
pull_request: types: [closed]. - Delete Kubernetes namespace, Helm release, or AWS ECS service.
- Trigger cleanup workflow listening to