darkzn / ghubautopull
Darkzn98's Github Autopull
v1.0.0
2022-03-19 16:05 UTC
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
.env
file 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.