DevOps / Github Interview questions
Why should you use GitHub Environments to track deployments?
Without environments, a deploy job is just another workflow step whose outcome disappears into the run log. Adding an environment: key to that job turns it into something GitHub actively tracks over time: current deployment status per environment, full deployment history, and a direct link from a pull request to exactly what environment its changes went to.
Practically, this unlocks capabilities plain workflow logs can't provide: a deployments view showing the latest deployment per environment (staging, production, review apps), required reviewers who must approve before a job can deploy to a protected environment like production, wait timers before a deployment proceeds, and branch restrictions limiting which branches are even allowed to target that environment.
This is the mechanism that lets a team enforce "no one deploys to production without sign-off" as an actual platform-enforced rule rather than a policy people are trusted to follow, since the job simply won't run until a required reviewer approves it.
More Related questions...