Last Updated: February 25, 2016
·
1.518K
· wilk

Easy deployment on Github pages with GruntJS

You have your wonderful node app located at github.com/you/yourawesomenodeapp and a demo or docs located at you.github.io/yourawesomenodeapp, right?

Well, it's extremely easy to deploy it with grunt-gh-pages!

$ npm install grunt-gh-pages --save-dev

Then add it on your Gruntfile:

'gh-pages': {
  options: {
    base: 'dist' ,
    message: 'Generated by grunt gh-pages'
  } ,
  src: ['**/*']
}

And create a new deploy task in the same file:

grunt.registerTask ('deploy', ['gh-pages']);

Now, when you finish to make the build of your current project under dist folder, launch the following command:

$ grunt deploy

And your gh-pages branch will be updated automagically!

Have fun!