Use git-push to deploy your website to Azure, Heroku, GitHub Pages or any other hosting provider supporting Git-based deployments.
npm install git-push --save-dev
// deploy.js
var push = require('git-push');
push('./app', 'http://github.com/example/example.github.io', function() {
console.log('Done!');
});
$ node deploy.js
// 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
- Continuous deployment using Git in Azure App Service by Windows Azure
- Kudu - the engine behind Git deployments in Azure Web Apps by Windows Azure
- How To Set Up Automatic Deployment with Git with a VPS by DigitalOcean
- Deploying with Git by Heroku
- Git as a deployment tool by gitolite
The MIT License © Konstantin Tarkus (@koistya)