From 2b614a84cc2dfbb8b15fd1a56579e7810819ad2e Mon Sep 17 00:00:00 2001 From: Evan Willhite Date: Fri, 2 Mar 2018 14:50:29 -0600 Subject: [PATCH 1/3] replaced gulp-gh-pages with gh-pages --- index.js | 20 +++++++++++--------- package.json | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 5b915cb..3fbe65c 100644 --- a/index.js +++ b/index.js @@ -24,7 +24,7 @@ module.exports = (gulp, config) => { const svgSprite = require('gulp-svg-sprite'); // deploy - const ghPages = require('gulp-gh-pages'); + const ghpages = require('gh-pages'); const tasks = { compile: [], @@ -150,12 +150,14 @@ module.exports = (gulp, config) => { /** * Deploy */ - // eslint-disable-next-line func-names, prefer-arrow-callback - gulp.task('ghpages-deploy', function () { - return gulp.src([ - `${config.paths.dist_js}/**/*`, - `${config.paths.pattern_lab}/**/*`, - ], { base: config.themeDir }) - .pipe(ghPages()); - }); + const distDir = gulp.src([`${config.paths.dist_js}/**/*`, `${config.paths.pattern_lab}/**/*`], { base: config.themeDir }); + + ghpages.publish(distDir); + // gulp.task('ghpages-deploy', function () { + // return gulp.src([ + // `${config.paths.dist_js}/**/*`, + // `${config.paths.pattern_lab}/**/*`, + // ], { base: config.themeDir }) + // .pipe(ghPages()); + // }); }; diff --git a/package.json b/package.json index 78aad0d..57a5c05 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "browser-sync": "^2.11.0", "del": "^3.0.0", "eslint": "^4.3.0", + "gh-pages": "^1.1.0", "glob": "^7.0.3", "gulp": "^3.9.1", "gulp-autoprefixer": "^4.0.0", @@ -21,7 +22,6 @@ "gulp-clean-css": "^3.7.0", "gulp-concat": "^2.6.0", "gulp-flatten": "^0.3.1", - "gulp-gh-pages": "^0.5.4", "gulp-help": "^1.6.1", "gulp-if": "^2.0.1", "gulp-imagemin": "^3.3.0", From 92800940b3354fe39c75abdea0aed0b0bd3da49d Mon Sep 17 00:00:00 2001 From: Evan Willhite Date: Fri, 2 Mar 2018 14:58:46 -0600 Subject: [PATCH 2/3] gulp command wrapper --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3fbe65c..47fd22f 100644 --- a/index.js +++ b/index.js @@ -152,7 +152,9 @@ module.exports = (gulp, config) => { */ const distDir = gulp.src([`${config.paths.dist_js}/**/*`, `${config.paths.pattern_lab}/**/*`], { base: config.themeDir }); - ghpages.publish(distDir); + gulp.task('ghpages-deploy', () => { + ghpages.publish(distDir); + }); // gulp.task('ghpages-deploy', function () { // return gulp.src([ // `${config.paths.dist_js}/**/*`, From d055ad449f01f3085a168bf6374b41fefd08f5d2 Mon Sep 17 00:00:00 2001 From: Evan Willhite Date: Mon, 5 Mar 2018 10:59:54 -0600 Subject: [PATCH 3/3] deployment script fixes, error handling --- index.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 47fd22f..e8716ed 100644 --- a/index.js +++ b/index.js @@ -150,16 +150,16 @@ module.exports = (gulp, config) => { /** * Deploy */ - const distDir = gulp.src([`${config.paths.dist_js}/**/*`, `${config.paths.pattern_lab}/**/*`], { base: config.themeDir }); - gulp.task('ghpages-deploy', () => { - ghpages.publish(distDir); + // Create build directory. + gulp.src([`${config.paths.dist_js}/**/*`, `${config.paths.pattern_lab}/**/*`], { base: config.themeDir }).pipe(gulp.dest('build')); + // Publish the build directory to github pages. + ghpages.publish(`${config.themeDir}build`, (err) => { + if (err === undefined) { + console.log('Successfully deployed!'); + } else { + console.log(err); + } + }); }); - // gulp.task('ghpages-deploy', function () { - // return gulp.src([ - // `${config.paths.dist_js}/**/*`, - // `${config.paths.pattern_lab}/**/*`, - // ], { base: config.themeDir }) - // .pipe(ghPages()); - // }); };