I’d like to have a Git setup something like below.
Developer 1 --push-->
--> Github <--pull-- our server (public www folder)
Developer 2 --push-->
The main objective is to keep a copy of our website in a Github repo and let developers pull to the live site when everything looks OK.
So the idea is Developer 1 and 2 can clone the Github repo, make changes locally and push them back. And when we want to reflect those changes to the live site, it would simply be a matter of running git pull from the public www folder on the server.
I already have a setup like this for my own use, but the server is using my own Github account/key. This obviously isn’t ideal with multiple developers. So I think a good way might be to simply setup a generic Github account so each developer can simply use that to pull to the live site.
But I can’t help but feel like there is a better solution. Is there a better way; how would you do it?
That’s what deploy keys are for. Have a look at Managing deploy keys