Hi all.
I have a wordpress website which have 4 different environments: development, preview, staging and production. This all are connected to 4 remote repositories: development, preview, staging and production respectively.
The website is tracked by a plugin named Versionpress, which commits to the git repo all the changes done.
I need the staging environment to automatically push the changes committed to the remote staging repository, and I'm doing it using a git hook on commit.
Then I need the changes to be automatically pushed on the remote production repository, too.
The authentication method I use to do it is by passwordless SSH key stored on the Web Server, but I think this could be not so secure. Infact if the server is attacked, anyone who acess by the user which has the SSH key connected, could write on staging or production repository.
So the question is... do you know a more secure method to automatically push changes from a Web Server to a Git repository?
Thank you so much in advance.