How do you restrict which branches can deploy to production in GitHub and GitLab?
BeginnerProductionGitHub Actions and GitLab CI in Production
Answer
GitHub: environment production with "Deployment branches and tags" limited to main and v* tags. GitLab: protected environments with allowed deployers, and the job rules restricted to protected refs. Combine with branch protection so only reviewed code reaches the protected branch, and with protected tags so only release managers can create release tags.
More on GitHub Actions and GitLab CI in Production
How do you organise reusable workflows for an organisation on GitHub?IntermediateHow do you reduce GitHub Actions minutes cost on private repos?IntermediateHow do you secure self-hosted runners?AdvancedHow do you design the GitHub Actions OIDC trust policy for AWS safely?AdvancedHow do you handle approvals and deployments across environments in GitHub Actions?IntermediateHow do you handle required checks when workflows use path filters or matrices?Advanced