PHPackages                             highsolutions/github-hook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. highsolutions/github-hook

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

highsolutions/github-hook
=========================

A Laravel package for simple Continuous Integration based on GitHub push.

0.12.0(2y ago)81.5k21MITPHPPHP &gt;=7.1.3|&gt;=8.0.2

Since May 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/highsolutions/laravel-github-hook)[ Packagist](https://packagist.org/packages/highsolutions/github-hook)[ RSS](/packages/highsolutions-github-hook/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (2)Versions (17)Used By (1)

Laravel GitHub Hook
===================

[](#laravel-github-hook)

Easy continuous integration based on GitHub.

[![Laravel-GitHub-Hook by HighSolutions](https://raw.githubusercontent.com/highsolutions/laravel-github-hook/master/intro.jpg)](https://raw.githubusercontent.com/highsolutions/laravel-github-hook/master/intro.jpg)

Installation
------------

[](#installation)

Add the following line to the `require` section of your Laravel webapp's `composer.json` file:

```
    "require": {
        "HighSolutions/github-hook": "*"
    }
```

Run `composer update` to install the package.

This package uses Laravel 5.5 Package Auto-Discovery. For previous versions of Laravel, you need to update `config/app.php` by adding an entry for the service provider:

```
'providers' => [
    // ...
    HighSolutions\GitHubHook\GitHubHookServiceProvider::class,
];
```

Configuration
-------------

[](#configuration)

Finally, from the command line again, publish the default configuration file:

```
php artisan vendor:publish --provider="HighSolutions\GitHubHook\GitHubHookServiceProvider"
```

and you can specify some essentials settings (in ENV and in config file called `github-hook.php`):

Setting nameDescriptionENV variableDefault valueurlURL for webhook from GitHub to yourGITHUB\_HOOK\_URL/github/hook/branchPulled repository branch on serverGITHUB\_HOOK\_BRANCHmastersecretGitHub webook secret codeGITHUB\_HOOK\_SECRETnullhooks.beforeArray of commands to execute before composer actions (### is a separator).GITHUB\_HOOK\_HOOK\_BEFORE\[\]hooks.composerComposer update command (and dump-autoload). Set false to deactivate.GITHUB\_HOOK\_HOOK\_COMPOSERcomposer install --no-devhooks.migrationArtisan command for database migration. Set false to deactivate.GITHUB\_HOOK\_HOOK\_MIGRATIONphp artisan migrate --forcehooks.seedArtisan command for database seeding. Set false to deactivate.GITHUB\_HOOK\_HOOK\_SEEDphp artisan db:seed --forcehooks.refreshArtisan command for recreating database (migration and seeding). Set false to deactivate.GITHUB\_HOOK\_HOOK\_REFRESHphp artisan migrate:refresh --seed --forcehooks.cacheClear cache. Set false to deactivate.GITHUB\_HOOK\_HOOK\_CACHEphp artisan cache:clearhooks.viewClear compiled views. Set false to deactivate.GITHUB\_HOOK\_HOOK\_VIEWphp artisan view:clearhooks.afterArray of commands to execute after rest of hooks (### is a separator).GITHUB\_HOOK\_HOOK\_AFTER\[\]slack.senderName of sender of Slack notificationGITHUB\_HOOK\_SLACK\_SENDERGitHub Hookslack.channelChannel where Slack notification will be postedGITHUB\_HOOK\_SLACK\_CHANNELslack.webhook\_urlSlack webhook url. If empty, notification won't be send.GITHUB\_HOOK\_SLACK\_URLYou can specify whole configuration in .env file:

```
GITHUB_HOOK_URL=/github/hook/
GITHUB_HOOK_BRANCH=master
GITHUB_HOOK_SECRET=
GIHUB_HOOK_BEFORE="php artisan help###php artisan help"
GITHUB_HOOK_HOOK_MIGRATION="php artisan migrate --force"
GITHUB_HOOK_HOOK_SEED="php artisan db:seed --force"
GITHUB_HOOK_HOOK_REFRESH="php artisan migrate:refresh --seed --force"
GITHUB_HOOK_HOOK_COMPOSER="php composer.phar install --no-dev"
GITHUB_HOOK_HOOK_CACHE="php artisan cache:clear"
GITHUB_HOOK_HOOK_VIEW="php artisan view:clear"
GIHUB_HOOK_AFTER="php artisan help###php artisan optimize"
GITHUB_HOOK_HOOK_SENDER=GitHub
GITHUB_HOOK_SLACK_CHANNEL=
GITHUB_HOOK_SLACK_URL=
```

Remember surround values containg spaces with `"`.

No Laravel version
------------------

[](#no-laravel-version)

This package is also configured to work not within Laravel. We recommend:

- Create `hook` folder
- Copy whole package to this folder
- Create another file (e.g. `awesome_hook.php`) and paste in it:

```
