Version control , ci/cd, development with git


Is there any best practice how to develop a WP site with proper version control, and ci/cd?
I mean every WP developer would use an IDE to develop the theme, and install plugins on a local WP environment for developing the site, after that they would commit, push, merge back to git and with ci/cd they could deploy(or automaticaly) the upgraded site to a test env, and after that to the prod server.