Interview Prep/Git & GitHub/Scale, Submodules, LFS and GitHub Automation

Every PR should get its own preview environment, cleaned up automatically.

IntermediateScenarioScale, Submodules, LFS and GitHub Automation
Answer

Situation read → Environments must be created on open and destroyed on close.

What I'd do →

  1. Trigger on pull_request with types opened, synchronize, reopened and closed.
  2. Name resources with the PR number (app-pr-482) and deploy to a namespace or stack.
  3. On closed, run a teardown job; also run a nightly sweeper for leftovers.
  4. Post the preview URL as a PR comment and use a GitHub deployment for status.

Why → Reviewers test real behaviour, and cost stays bounded by cleanup.

Interview tip → Never give fork PRs access to deployment secrets.

All Git & GitHub questions Roadmap: Git & GitHub

More on Scale, Submodules, LFS and GitHub Automation