git-push

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

Usage no npm install needed!

<script type="module">
  import gitPush from 'https://cdn.skypack.dev/git-push';
</script>

README

git-push Tips

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

Install

NPM

npm install git-push --save-dev

Example 1

// deploy.js

var push = require('get-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 push = require('get-push');
var argv = require('minimist')(process.argv.slice(2));

gulp.task('build', 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 (MIT) © Konstantin Tarkus (@koistya)