Skip to main content
InterviewHubPRO
Section Overview
Q42

Question 42 of 50

Part 3: Enterprise Scale, Compliance & Production Hardening (Senior / Staff)

84%
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:

  1. 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.
  2. PR Closed:
    • Trigger cleanup workflow listening to pull_request: types: [closed].
    • Delete Kubernetes namespace, Helm release, or AWS ECS service.