darkzn / ghubautopull
Darkzn98's Github Autopull
Installs: 62
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/darkzn/ghubautopull
Requires
- php: >=7.3.9
README
Author: Darkzn98 darkzn98@gmail.com
About
GHubAutoPull is a composer package for Laravel and Lumen. This package used for running git pull and composer install
on configured server using Github Webhook automatically.
Requirements
- PHP >= 7.3.9
- Github Webhook
- Server SSH Key Saved to GitHub
Usage
- Add the package running this command
composer require darkzn/ghubautopull
- Add this package to service your app service provider so the route registered.
For Laravel config/app.php:
'providers' = >[ // Other Providers Darkzn\Ghubautopull\GhubAutopullServiceProvider::class, ],
For Lumen bootstrap/app.php:
$app->register(Darkzn\Ghubautopull\GhubAutopullServiceProvider::class);
- Configure Github Webhook with the webhook url of
https://{YOUR_APP_URL}/hook.json. Don't forget to set the Webhook Secret! - Configure the
.envfile by adding this code
# Webhook Secret GHUB_WEBHOOK_SECRET=testwebhooklaravel # Webhook Branch (Will exec git pull if github ref matched branch deploy variable) GHUB_BRANCH_DEPLOY=master
- Test the webhook.