Created
February 26, 2018 13:46
-
-
Save Eworm/6674c2c084d09b9789f20e2413fc4ad3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Use in the "Post-Receive URLs" section of your GitHub repo. | |
if ( $_POST['payload'] ) { | |
$data = json_decode($_POST['payload']); | |
if ($data->ref == 'refs/heads/master') { | |
shell_exec( 'cd /home/YOURNAME/webapps/WEBAPPNAME && git pull' ); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment