Skip to content

Commit ba34102

Browse files
committed
chore(grunt): Fix auto ngdoc publish grunt task
1 parent 72cabce commit ba34102

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

Gruntfile.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ module.exports = function (grunt) {
119119
grunt.registerTask('default', ['build', 'jshint', 'karma:unit']);
120120
grunt.registerTask('build', 'Perform a normal build', ['concat', 'uglify']);
121121
grunt.registerTask('dist', 'Perform a clean build', ['clean', 'build']);
122-
grunt.registerTask('dist-pages', 'Perform a clean build and generate documentation', ['dist', 'ngdocs']);
122+
grunt.registerTask('dist-docs', 'Perform a clean build and generate documentation', ['dist', 'ngdocs']);
123123
grunt.registerTask('release', 'Tag and perform a release', ['prepare-release', 'dist', 'perform-release']);
124124
grunt.registerTask('dev', 'Run dev server and watch for changes', ['build', 'connect:server', 'karma:background', 'watch']);
125125
grunt.registerTask('sample', 'Run connect server with keepalive:true for sample app development', ['connect:sample']);
@@ -130,9 +130,11 @@ module.exports = function (grunt) {
130130
shjs.rm('-rf', 'build');
131131
return system('git checkout gh-pages');
132132
}).then(function () {
133-
return system('git merge master');
133+
return system('git rebase master');
134134
}).then(function () {
135-
return system('grunt dist-pages');
135+
return system('git pull');
136+
}).then(function () {
137+
return system('grunt dist-docs');
136138
}).then(function () {
137139
return system('git commit -a -m \'Automatic gh-pages build\'');
138140
}).then(function () {
@@ -141,6 +143,19 @@ module.exports = function (grunt) {
141143
);
142144
});
143145

146+
grunt.registerTask('push-pages', 'Push published pages', function () {
147+
promising(this,
148+
ensureCleanMaster().then(function () {
149+
shjs.rm('-rf', 'build');
150+
return system('git checkout gh-pages');
151+
}).then(function () {
152+
return system('git push origin gh-pages');
153+
}).then(function () {
154+
return system('git checkout master');
155+
})
156+
);
157+
});
158+
144159
grunt.registerTask('prepare-release', function () {
145160
var bower = grunt.file.readJSON('bower.json'),
146161
component = grunt.file.readJSON('component.json'),

0 commit comments

Comments
 (0)