From 8c25dae8da27c6008502d3c425053f465a4a7636 Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Sun, 29 Mar 2020 16:25:20 -0700 Subject: [PATCH] Try to add deploy command to gulp --- gulpfile.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 76d68861..b5bff1b2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -161,6 +161,20 @@ var gitAdd = function(done) { done(); }; +var gitDeployMergeMaster = function(done) { + execSync('git checkout gh-pages && git merge master -m "merge master"'); + done(); +}; + +var gitDeployPushOrigin = function(done) { + execSync('git commit -am "rebuild for prod" && ' + + 'git push origin gh-pages && ' + + 'git branch -f trunk gh-pages && ' + + 'git checkout master' + ); + done(); +} + var fastBuild = series(clean, ifyBuild, style, buildIndexDev, jshint); var build = series( @@ -168,7 +182,17 @@ var build = series( miniBuild, style, buildIndexProd, gitAdd, jasmine, jshint, lintStrings, compliment - ); +); + +var deploy = series( + clean, + jasmine, + jshint, + gitDeployMergeMaster, + build, + gitDeployPushOrigin, + compliment, +); var lint = series(jshint, compliment); @@ -189,4 +213,5 @@ module.exports = { watching, build, test: jasmine, + deploy, };