/git-push

Use git-push to deploy your website to Azure, Heroku, GitHub Pages or any another hosting provider supporting Git-based deployments.

Primary LanguageJavaScriptMIT LicenseMIT

git-push

NPM version NPM downloads Build Status Dependency Status Tips Discussion

Use git-push to deploy your website to Azure, Heroku, GitHub Pages or any other hosting provider supporting Git-based deployments.

Install

npm install git-push --save-dev

Example 1

// deploy.js

var push = require('git-push');

push('./app', 'http://github.com/example/example.github.io', function() {
  console.log('Done!');
});
$ node deploy.js

Example 2

// gulpfile.js

var gulp = require('gulp');
var del = require('del');
var push = require('git-push');
var argv = require('minimist')(process.argv.slice(2));

gulp.task('clean', del.bind(null, ['build/*', '!build/.git'], {dot: true}));

gulp.task('build', ['clean'], function() {
  // TODO: Build website from source files into the `./build` folder
});

gulp.task('deploy', function(cb) {
  var remote = argv.production ?
    {name: 'production', url: 'http://github.com/user/example.com', branch: 'gh-pages'},
    {name: 'test', url: 'http://github.com/user/test.example.com', branch: 'gh-pages'};
  push('./build', remote, cb);
});
$ gulp build --release
$ gulp deploy --production

API

push(sourceDir, remote, callback);

Reference

License

The MIT License © Konstantin Tarkus (@koistya)