File structure
Separate files per environment
The simplest approach — one file per environment:Base + override files
Share common definitions in a base file and override per environment:-f flags:
Using environment variables
Share a single file and vary behavior with environment variables:GitHub Actions
Using environments
Sequential with approval
production environment in GitHub Settings to require manual approval.
GitLab CI
Terraform
Use Terraform workspaces or separate state files:Best practices
- Separate API tokens per environment for isolation
- Deploy staging first, then promote to production
- Use GitHub Environments or equivalent for approval gates on production
- Pin CLI versions for reproducible builds across environments
- Keep environment differences minimal — vary URLs and frequencies, not monitor structure
Next steps
GitHub Actions
Full setup-devhelm action reference.
Environments CLI
Manage environments from the command line.