I'm spinning up a production site and wanted to get advice on the latest best practices to manage and deploy multiple environments. At a high level, I'd like to have a good balance between keeping prod from being broken vs dev speed.
This is my best high-level guess at what I should strive for:
Have devs try to ship small changes + small branches into trunk branches to avoid overhead.
Have multiple environments aside from prod, say a "dev" environment.
Have the "dev" environment use CI/CD so that whenever branches merge into trunk, the "dev" environment will build and deploy the latest trunk
Dogfood / QA "dev" environment frequently, and whenever we feel good about it and want to ship to prod new features that made into "dev", we manually deploy the current trunk to "prod" environment.
Thoughts on this approach? If this seems reasonable, I was wondering about tips on the details:
- To prevent bad trunk merges from breaking prod, does this imply deploying to "prod" environments is entirely manual w/o any CI / CD? Is this a common practice?
- We're using github. Would it make sense for both "prod" and "dev" environments to deploy from the master branch (aka trunk branch), one automatically vs one manually? Or would it make more sense for a separate prod release branches like "prod-release-v1", "prod-release-v2", etc. where we just cut from from the right commit in trunk branch whenever we want to deploy to prod?
- We're a lean startup, 10 people atm, and looking to scale a bit more.
- We have prod website up and running and enough customers that it's worth investing in this to avoid too much breakage.
- AWS is most of our stack, but also comfortable with adding any other devops tech that's well recommended in the industry.
Appreciate any help or pointers I can get as a noob devops eng! Thank you!