Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Github Pages deployment fix #74

Merged
merged 3 commits into from
Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down Expand Up @@ -150,12 +150,16 @@ 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());
gulp.task('ghpages-deploy', () => {
// 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);
}
});
});
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down