Skip to content
This repository has been archived by the owner on Apr 12, 2019. It is now read-only.
/ git-deploy Public archive
forked from vicenteguerra/git-deploy

A PHP script to automatically pull from a repository to a web server (using a webhook on GitLab, GitHub or Bitbucket).

Notifications You must be signed in to change notification settings

JacobDB/git-deploy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

git-deploy

A PHP script to automatically pull from a repository to a web server (using a webhook on GitHub, GitLab, or Bitbucket).

You can configure which branch this script pulls from. This script is useful for both development and production servers.


On your server

SSH

Generate an SSH key and add it to your account so that git pull can be run without a password.

Configuration

Copy the git-deploy folder and its contents in to your public folder (typically public_html). Note that you can change the name of the folder if desired.

Rename git-deploy/config.sample.php to git-deploy/config.php, and update each variable.

  define('TOKEN', 'your-secret-token');
  define('REMOTE_REPOSITORY', 'your-repository');
  define('DIR','your-absolute-path-to-git');
  define('AFTER_PULL','your-shell-commands');

On GitHub | GitLab | Bitbucket

GitHub

In your repository, navigate to Settings → Webhooks → Add webhook, and use the following settings:

Click "Add webhook" to save your settings, and the script should start working.

Example screenshot showing GitHub webhook settings

GitLab

In your repository, navigate to Settings → Integrations, and use the following settings:

Click "Add webhook" to save your settings, and the script should start working.

Example screenshot showing GitLab webhook settings

Bitbucket

In your repository, navigate to Settings → Webhooks → Add webhook, and use the following settings:

Click "Save" to save your settings, and the script should start working.

Example screenshot showing Bitbucket webhook settings


Support on Beerpay

Hey dude! Help me out by buying me a couple of 🍻!

Beerpay Beerpay

About

A PHP script to automatically pull from a repository to a web server (using a webhook on GitLab, GitHub or Bitbucket).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%