Salesforce CI/CD with GitHub Actions
A pragmatic pipeline you can ship quickly and harden progressively.
Goals
- Validate PRs (lint, tests)
- Deploy safely to target orgs
- Keep secrets secure
- Reduce “works on my machine” issues
Suggested stages
- PR validation: run unit tests + static checks
- UAT: deploy to a sandbox, run smoke tests
- Production: controlled deployment, manual approvals if needed
Best practices
- Prefer scratch orgs or dedicated sandboxes for validation
- Use least privilege secrets in CI
- Add a rollback plan and a clear change log
We can add a real YAML example and explain each line step-by-step.