Experimental publish task for gh-pages

This commit is contained in:
Vadim Makeev 2014-05-09 15:31:40 +02:00
parent 69c99d74a7
commit e450088636
2 changed files with 83 additions and 2 deletions

View File

@ -9,9 +9,86 @@ module.exports = function(grunt) {
commitFiles: ['package.json', 'bower.json'], commitFiles: ['package.json', 'bower.json'],
pushTo: 'origin' pushTo: 'origin'
} }
} },
copy: {
prepare: {
files: [{
src: [
'**',
'!node_modules/**',
'!bower_components/**',
'!Contributing.md',
'!Gruntfile.js',
'!License.md',
'!Readme.md',
'!bower.json',
'!package.json'
],
dest: 'temp/'
},{
expand: true,
cwd: 'node_modules/shower-core/',
src: [
'**',
'!package.json',
'!Readme.md'
],
dest: 'temp/shower/'
},{
expand: true,
cwd: 'node_modules/shower-ribbon/',
src: [
'**',
'!package.json',
'!Readme.md'
],
dest: 'temp/shower/themes/ribbon/'
},{
expand: true,
cwd: 'node_modules/shower-bright/',
src: [
'**',
'!package.json',
'!Readme.md'
],
dest: 'temp/shower/themes/bright/'
}]
}
},
replace: {
core: {
src: 'temp/index.html',
overwrite: true,
replacements: [{
from: /(node_modules|bower_components)\/shower-core/g,
to: 'shower'
},{
from: /(node_modules|bower_components)\/shower-(ribbon|bright)/g,
to: 'shower/themes/$2'
}]
},
themes: {
src: 'temp/shower/themes/*/index.html',
overwrite: true,
replacements: [{
from: '../shower-core', to: '../..'
}]
}
},
'gh-pages': {
options: {
base: 'temp'
},
src: ['**']
},
clean: ['temp']
}); });
grunt.registerTask('default', ['bump']); grunt.registerTask('publish', [
'copy',
'replace',
'gh-pages',
'clean'
]);
}; };

View File

@ -33,6 +33,10 @@
"devDependencies": { "devDependencies": {
"grunt": "^0.4.4", "grunt": "^0.4.4",
"grunt-bump": "0.0.13", "grunt-bump": "0.0.13",
"grunt-contrib-clean": "^0.5.0",
"grunt-contrib-copy": "^0.5.0",
"grunt-gh-pages": "^0.9.1",
"grunt-text-replace": "^0.3.11",
"load-grunt-tasks": "^0.4.0" "load-grunt-tasks": "^0.4.0"
} }
} }