2017 © Pedro Peláez
 

library github-deployment

Deployment with GitHub and pure PHP. No git on server or ftp needed.

image

godric/github-deployment

Deployment with GitHub and pure PHP. No git on server or ftp needed.

  • Monday, December 11, 2017
  • by godric
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Deploy with GitHub and pure PHP. No git on server or ftp needed., (*1)

Usage

  1. Install with: composer require godric/github-deployment dev-master
  2. Create deployment script, for example deploy.php with following contents:
<?php // deploy.php in website root

require 'vendor/autoload.php';

(new Godric\GithubDeployment\GithubDeployment([
    'secret'    =>  'your_secret',  // pick your secret
    'target'    =>  __DIR__ . '/.', // directory beeing synchronized – same as deploy.php
]))->autorun();
  1. Upload new files to your server.
  2. Go to: (your github repo) > settings > webhooks > add webhook
  3. Set url to http://yoursite.com/deploy.php and secret to your_secret.
  4. Done! From now on, all files added/modified/removed in new commits to master will appear on your server.

Features

  • No need for git or system() calls on remote server – should work well with shared hosts.
  • Works with pushes to master as well as pull-request merging.
  • Multiple commits in one push are also OK.
  • Current contents of remote directory are not modified – only changes in commits are applied.
  • Automatic composer install on remote before updating files.
  • TODO: custom before or after scripts (for example DB migrations).

Requirements

  • Write access to target directory.

Notes

Test scenarios TBD

  • new file in non-existent directory
  • exotic directory names

The Versions

11/12 2017

dev-master

9999999-dev

Deployment with GitHub and pure PHP. No git on server or ftp needed.

  Sources   Download

The Requires