Reputation:
I have been trying to move away from FTP for some time now.
After getting to grips with GIT (what have I been missing!), pushing commits to GitHub and then finally pulling the changes to my remote server I am looking to have this last stage automated (The remote server should always watch for new pushes to Github and Pull any changes).
A tutorial video I have been watching suggests using Github webhooks and a php file that executes a shell command
<?php `git pull`; ?>
I'm not entirely sure if this is the most effective way of setting up this automation, could anyone shed some light on a good approach to syncing my githhub and remote server?
Many Thanks
Thought I should edit this to show my current progress.
index.html
github.php - <?php
git pull`; ?> (back ticks for shell command)
Commited and pushed to github repo
On remote server, created a non passworded SSH key
On github, Pasted SSH key into REPO > Settings > Deploy Key
As far as I am aware this should now be sending a pull_request to github.php when commits are pushed to Github which should then transfer all updated files to remote server
I think I understand the actual process well enough but think I may be missing something important, just to clarify if I run a manual PULL request on the remote server everything works fine but it is not automated which is my main goal
Upvotes: 2
Views: 1022
Reputation:
My bad, deploy key was enter incorrectly. For anyone looking to automate github deployment I would recommend this simple approach
Upvotes: 1