godric / github-deployment
Deployment with GitHub and pure PHP. No git on server or ftp needed.
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/godric/github-deployment
Requires
- composer/composer: ^1.5
This package is auto-updated.
Last update: 2025-12-06 11:58:12 UTC
README
Deploy with GitHub and pure PHP. No git on server or ftp needed.
Usage
- Install with:
composer require godric/github-deployment dev-master - Create deployment script, for example
deploy.phpwith following contents:
<?php // deploy.php in website root require 'vendor/autoload.php'; (new Godric\GithubDeployment\GithubDeployment([ 'secret' => 'your_secret', // pick your secret 'target' => __DIR__ . '/.', // directory beeing synchronized – same as deploy.php ]))->autorun();
- Upload new files to your server.
- Go to: (your github repo) > settings > webhooks > add webhook
- Set url to
http://yoursite.com/deploy.phpand secret toyour_secret. - Done! From now on, all files added/modified/removed in new commits to
masterwill appear on your server.
Features
- No need for git or
system()calls on remote server – should work well with shared hosts. - Works with pushes to master as well as pull-request merging.
- Multiple commits in one push are also OK.
- Current contents of remote directory are not modified – only changes in commits are applied.
- Automatic
composer installon remote before updating files. - TODO: custom before or after scripts (for example DB migrations).
Requirements
- Write access to target directory.
Notes
Test scenarios TBD
- new file in non-existent directory
- exotic directory names