Skip to content

Commit d528333

Browse files
李钿李钿
authored andcommitted
增加自动部署 github gh-pages 分支
1 parent f831cdb commit d528333

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

gulpfile.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var webpack = require('webpack');
33
var clean = require('gulp-clean');
44
var gutil = require('gulp-util');
55
var ftp = require( 'vinyl-ftp' );
6+
var ghPages = require('gulp-gh-pages');
67
var deploy = require('./deploy.config.json');
78
var deploy_remote_path = "/public/17zt/viewer"
89
var webpack_config_demo = require('./webpack.config.example.js');
@@ -29,4 +30,11 @@ gulp.task('deploy:demo', ['build:demo'], function () {
2930
.pipe(conn.dest(deploy_remote_path))
3031
})
3132

32-
gulp.task('demo', ['deploy:demo']);
33+
gulp.task('deploy:gh-pages', ['build:demo'], function() {
34+
return gulp.src('./demo/**')
35+
.pipe(ghPages());
36+
});
37+
38+
gulp.task('demo', ['deploy:demo']);
39+
40+
gulp.task('gh-pages', ['deploy:gh-pages']);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"file-loader": "^0.11.1",
3636
"gulp": "^3.9.1",
3737
"gulp-clean": "^0.3.2",
38+
"gulp-gh-pages": "^0.5.4",
3839
"gulp-util": "^3.0.8",
3940
"html-webpack-plugin": "^2.28.0",
4041
"less": "^2.7.2",

0 commit comments

Comments
 (0)