Workflow pattern
The standard CI/CD pattern for monitoring as code:- On PR: Run
devhelm validateanddevhelm planto catch errors and preview changes - On merge to main: Run
devhelm deploy --yesto apply the configuration
Choose your tool
GitHub Actions
Official setup-devhelm action with caching, version pinning, and verification.
Generic CI
GitLab CI, Jenkins, CircleCI, Bitbucket — any system that runs npm.
Multi-environment
Deploy different configs to staging and production.
Terraform CI/CD
Terraform plan and apply in CI pipelines.
Key concepts
Validate → Plan → Deploy
| Stage | Command | API calls | Writes |
|---|---|---|---|
| Validate | devhelm validate devhelm.yml | None | None |
| Plan | devhelm plan -f devhelm.yml | Read-only | None |
| Deploy | devhelm deploy -f devhelm.yml --yes | Read + write | Yes |
Exit codes for gating
Use--detailed-exitcode to make deploy decisions in CI:
| Exit code | Meaning | CI action |
|---|---|---|
0 | No changes | Pass |
10 | Changes pending | Flag for review or auto-deploy |
1 | Error | Fail the build |
Deploy locking
The CLI acquires a lock before applying changes. Only one deploy runs at a time per organization. In CI, use--lock-timeout to queue behind other deploys:
Secret management
StoreDEVHELM_API_TOKEN and other sensitive values as CI secrets. Reference them in YAML with ${VAR} syntax:
Next steps
Deploy workflow
Detailed validate-plan-deploy lifecycle.
Drift and locking
How drift detection and deploy locks work.