Take it one step at a time. First of you need to learn git. You use it outside of docker to manage your files and branches. Your idea is correct, but while learning I would suggest you make it a bit more simple for yourself. Make a main/master branch for production and learn how to make branches, and how to merge them back into main/master. Once you have a very solid understanding of how this works (handling merge failures etc), you can start learning deployment strategies like the one you mentioned. But take it as a 2 step process (or more) as having to learn git as well as deployment (CI) at the same time will be too much
Git
Majority of the websites I make uses Laravel, NGINX, MySQL.
I have just dived into learning how to use Docker. As time goes on my knowledge and experience will definitely improve. So, now I want to use Git (Gitlab) to push my files to my server. Should I initialise Git in my local environment? Or within the Docker?
I’d really like to manage and deploy my websites in an efficient way. I was researching but there isn’t much out there on this topic. So if you know where I am getting at and you can pitch in please elaborate
For an instance I’d have two branches
Release: Code for live site
Staging: Code for dev site
Whenever, I am working on something on my site e.g a new login. I’d create a new branch called login. From there I’d commit and note each push. Whenever, I am complete I’d merge the branch with the Staging. After that I’d tag the Staging branch with eg. V1.2.4 and push tag to the Release branch. When the Release branch is updated it will automatically update the live server files.
I’ve seen someone else’s work and this is how they manage it I believe however, remembering all of it was hard.
I’d like to have something like this but setting it up and having a better understanding is what I need.
Please let me know your thoughts or an efficient way of pushing my work to my server.
Please or to participate in this conversation.