Many projects these days keep their work in github and it is a request often to make some dev site automated automatically. When I tried to enter a passworded URL into github, it didn't work. So I came up with what's below.
Create a PHP file (I have used a filename containing 63 alphanumeric characters but only because I am paranoid):
exec('git pull', $output);
file_put_contents('/tmp/gitpulllast', date('c') . "\n" . implode("\n", $output));
then change the password-protecting .htaccess:
SetEnvIf Request_URI "/path/to/the/above.php$" github_uri
AuthName "this is my devsite"
Deny from all
Allow from env=github_uri
then supply the URL to github as a post receive hook URL.
Edit: for this, you need a passwordless SSH key on the server and added to github.
Commenting on this Story is closed.