CI/CD & GitHub Actions (50 Qs)•Part 3: Enterprise Scale, Compliance & Production Hardening (Senior / Staff)
Deployment Protection Rules and Environment Approvals for multi-stage enterprise deployments.
senior LevelCode ExampleKubernetes
In Simple Words: GitHub Environments provide production safeguards:
- Required Reviewers: Deployments pause and trigger email/Slack notifications until specified senior engineers or team leads approve.
- Wait Timers: Delays deployment execution (e.g., wait 30 minutes in canary stage before proceeding to production).
- Deployment Branches: Enforce that the
productionenvironment can strictly be triggered only from themainbranch.
yaml
jobs:
deploy-prod:
environment:
name: production
url: https://prod.example.com
runs-on: ubuntu-latest
steps:
- run: ./deploy.sh