PHP code example of vijaycs85 / github-publisher
1. Go to this page and download the library: Download vijaycs85/github-publisher library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vijaycs85 / github-publisher example snippets
$php
cs85\GithubPublisher\Repository;
use Vijaycs85\GithubPublisher\Builder;
// Github repository name in username/projectname format.
$repository = new Repository('vijaycs85/static-site', \getenv('GITHUB_TOKEN'));
// Pass location of clone.
$builder = new Builder(__DIR__ . '/build', $repository);
// Directory that contains souce code and branch to push.
$builder->publish(__DIR__ . '/public', 'gh-pages');