darkzn/ghubautopull

Darkzn98's Github Autopull

v1.0.0 2022-03-19 16:05 UTC

This package is auto-updated.

Last update: 2025-07-19 23:37:42 UTC


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

  1. Add the package running this command
composer require darkzn/ghubautopull
  1. 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);
  1. Configure Github Webhook with the webhook url of https://{YOUR_APP_URL}/hook.json. Don't forget to set the Webhook Secret!
  2. 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
  1. Test the webhook.