Question on GitHub branches and actions
# help-with-other
m
I am very new to GitHub and code repositors and need some help figuring out how branches work and dev/staging/prod environments. If have created a repo to hose my production Umbraco site's code and it has a GitHub Action so that when code is checked into the repo it does a build and deploy to the production server. I am about to start a major overhaul of the site's layout and will be developing that in a staging environment. If I want to have an action so the staging gets updated with code checking like production should I be making a new repo for the staging environment or can I do this with a branch off the main code system?
j
What most people do is 1 repo, then a branch strategy, fx you could develop on a
dev
branch which then gets merged into a
stage
branch which gets merged into a
live
branch. And each of those branches would then correspond to an environment. In your github actions you can have multiple deployment stages that target different environments, and they can then have a condition based on the branchname - so they will only trigger for their respective branches
m
Thanks, that is exactly what I was hoping to be able to do was just not sure if I could do it as I am very new to GitHub, Version Control, and all this good stuff.
m
Might be good reading (modified gitFlow) https://nvie.com/posts/a-successful-git-branching-model/
3 Views