Skip to content

Commit

Permalink
Replace deploying package (#23)
Browse files Browse the repository at this point in the history
* replace gulp-gh-pages with gh-pages

* change gulp recipe

* update npm script
  • Loading branch information
tomasmcm authored and renatodeleao committed Dec 15, 2017
1 parent d246f36 commit 218c4ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
25 changes: 6 additions & 19 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import broswerSync from "browser-sync"
import runSequence from "run-sequence"
import minimist from "minimist"
import webpack from "webpack"
import ghpages from "gh-pages";

// import webpackDevMiddleware from 'webpack-dev-middleware'
// import webpackHotMiddleware from 'webpack-hot-middleware'
Expand Down Expand Up @@ -321,26 +322,12 @@ gulp.task("default", () => {

/**
* =======================================================
* $ Deploy site to gitHubPages
* [1] add CNAME copy task to have custom domains
* [2] Not working due https://github.com/shinnn/gulp-gh-pages/issues/116
* use `npm run deploy:site` only works on master.
* http://ianmcnally.me/blog/2016/2/4/variables-in-npm-scripts
* $ gulp deploy --env production
* =======================================================
*/

gulp.task('deploy:gh-pages', function() {
return gulp.src(`${paths.site.dest}/**/*`)
.pipe($.ghPages({
message: `Update ${pkg.version} [timestamp]`
}));
gulp.task("deploy", ["build"], function(cb) {
ghpages.publish(paths.site.dest, {
message: `Update ${pkg.version} [timestamp]`
}, cb);
});


// pass flag --env production when using
gulp.task("deploy:site", () => {
runSequence(
"build",
"deploy:gh-pages"
)
})
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start:production": "gulp --env production",
"build:production": "gulp build --env production",
"test": "echo \"Error: no test specified\" && exit 1",
"deploy:site": "cd node_modules/gulp-gh-pages/ && npm install --save [email protected] && cd .. && cd .. && gulp deploy:site --env production"
"deploy:site": "gulp deploy --env production"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -40,11 +40,11 @@
"coffee-loader": "^0.7.2",
"coffee-script": "^1.9.3",
"del": "^3.0.0",
"gh-pages": "^1.1.0",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.0.1",
"gulp-clean-css": "^3.9.0",
"gulp-data": "^1.2.0",
"gulp-gh-pages": "^0.5.4",
"gulp-jade": "^1.1.0",
"gulp-json-editor": "^2.2.1",
"gulp-load-plugins": "^1.0.0-rc.1",
Expand Down Expand Up @@ -85,4 +85,4 @@
"gzip": "2.78 kB"
}
}
}
}

0 comments on commit 218c4ec

Please sign in to comment.