Based on Automatic BitBucket Deploy script by Igor Lilliputten which was based on «Automated git deployment» script by Jonathan Nicoal.
Version 0.1.0 Last changes 2018.03.29
- Support for multiple projects and branches. See array
$PROJECTS
in config.sample.php. - Optional fetching or cloning repositiories demand on their presence.
- Create Project and repository folders automaticaly if they do not exists.
- Post hook command execution.
- PHP 5.3+
- Git installed
- Shell access
- PHP system function
- SSH key pair for github created with empty passphrase
- Secret key added to your webhook
You will need to set up a Deploy Key on the server add it to your repository.
Also you must set up an environment variable GIT_TOKEN which will help secure your webhook.
In your Github Repository settings, set your hooks Payload URL to point to github-hook.php. You should probably also rename this file to something unique.