Skip to content

Commit be7807c

Browse files
authored
Merge pull request pcottle#666 from pcottle/addDeploy
Try to add deploy command to gulp
2 parents ef48f02 + 8c25dae commit be7807c

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

gulpfile.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,38 @@ var gitAdd = function(done) {
161161
done();
162162
};
163163

164+
var gitDeployMergeMaster = function(done) {
165+
execSync('git checkout gh-pages && git merge master -m "merge master"');
166+
done();
167+
};
168+
169+
var gitDeployPushOrigin = function(done) {
170+
execSync('git commit -am "rebuild for prod" && ' +
171+
'git push origin gh-pages && ' +
172+
'git branch -f trunk gh-pages && ' +
173+
'git checkout master'
174+
);
175+
done();
176+
}
177+
164178
var fastBuild = series(clean, ifyBuild, style, buildIndexDev, jshint);
165179

166180
var build = series(
167181
clean,
168182
miniBuild, style, buildIndexProd,
169183
gitAdd, jasmine, jshint,
170184
lintStrings, compliment
171-
);
185+
);
186+
187+
var deploy = series(
188+
clean,
189+
jasmine,
190+
jshint,
191+
gitDeployMergeMaster,
192+
build,
193+
gitDeployPushOrigin,
194+
compliment,
195+
);
172196

173197
var lint = series(jshint, compliment);
174198

@@ -189,4 +213,5 @@ module.exports = {
189213
watching,
190214
build,
191215
test: jasmine,
216+
deploy,
192217
};

0 commit comments

Comments
 (0)