From 12de3c2b5e6291da8fd274839baa59359301db82 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Tue, 25 Nov 2014 08:36:01 -0500 Subject: [PATCH] Set up the GitHub Pages command Now we can synchronize GitHub Pages with the docs in the master branch quickly and easily. --- Gruntfile.js | 19 ++++++++++++++++++- package.json | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 85d435d3..6a3591ea 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -32,6 +32,10 @@ module.exports = function (grunt) { } grunt.initConfig({ + clean: { + docs: ['docs/_site'] + }, + uglify: { 'dist': { src: 'dist/js/select2.js', @@ -49,6 +53,17 @@ module.exports = function (grunt) { ] }, + 'gh-pages': { + options: { + base: 'docs', + clone: 'node_modules/grunt-gh-pages/repo', + message: 'Updated docs with master', + push: false, + repo: 'git@github.com:kevin-brown/select2.git' + }, + src: '**' + }, + jekyll: { options: { src: 'docs', @@ -192,6 +207,7 @@ module.exports = function (grunt) { } }); + grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-qunit'); @@ -199,6 +215,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-gh-pages'); grunt.loadNpmTasks('grunt-jekyll'); grunt.loadNpmTasks('grunt-sass'); @@ -210,5 +227,5 @@ module.exports = function (grunt) { grunt.registerTask('docs', ['jekyll:serve']); - grunt.registerTask('release', ['default', 'jekyll:build']); + grunt.registerTask('release', ['default', 'clean:docs', 'gh-pages']); }; diff --git a/package.json b/package.json index 6652308d..495fa8c6 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "devDependencies": { "grunt": "^0.4.5", "grunt-cli": "^0.1.13", + "grunt-contrib-clean": "^0.6.0", "grunt-contrib-concat": "^0.4.0", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-nodeunit": "~0.3.3", @@ -40,6 +41,7 @@ "grunt-contrib-requirejs": "^0.4.4", "grunt-contrib-uglify": "~0.4.0", "grunt-contrib-watch": "~0.6.0", + "grunt-gh-pages": "^0.9.1", "grunt-sass": "~0.12.0", "node-sass": "~0.8.6" }