forked from ringcentral/slate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
55 lines (48 loc) · 1.43 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* global require, module, process: false */
module.exports = function(grunt) {
'use strict';
var githubPagesDir = 'gh_pages';
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
exec: {
buildSlateDocs: {
cmd: function() {
return [
'bundle install',
'rm -rf build',
'bundle exec middleman build --clean'
].join(' && ');
}
},
checkoutDocs: {
cmd: function() {
return [
'rm -rf ' + githubPagesDir,
'git clone [email protected]:supportkit/supportkit-docs.git --branch gh-pages --single-branch ' + githubPagesDir,
'cp -R build/* ' + githubPagesDir
].join(' && ');
}
},
server: {
cmd: function() {
return 'bundle exec middleman server';
}
}
},
githubPages: {
docs: {
options: {
commitMessage: 'Update docs'
},
src: githubPagesDir
}
}
});
grunt.registerTask('logurl', function() {
grunt.log.write('http://localhost:4567');
});
grunt.registerTask('publish', function() {
grunt.task.run('exec:buildSlateDocs', 'exec:checkoutDocs', 'githubPages:docs');
});
grunt.registerTask('default', ['logurl', 'exec:server']);
};