forked from binary-com/binary-live-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
33 lines (28 loc) · 939 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var gulp = require('gulp');
var gh = require('gulp-gh-pages');
var webpack = require('webpack');
var gutil = require('gulp-util');
var pkg = require('./package.json');
/**
* Push build to gh-pages
*/
gulp.task('build', function(callback) {
webpack(require('./webpack.config.js'), function(err, stats) {
if(err) throw new gutil.PluginError("webpack", err);
gutil.log("[webpack]", stats.toString());
callback();
});
});
gulp.task('versioning', ['build'], function () {
var v = pkg.version;
return gulp.src(['lib/*.*'])
.pipe(gulp.dest('lib/' + v));
});
gulp.task('deploy', ['versioning'], function () {
return gulp.src(["./lib/**/*", "./CNAME"])
.pipe(gh({ force: true }));
});
gulp.task('deploy-prod', ['versioning'], function () {
return gulp.src(["./lib/**/*", "./CNAME"])
.pipe(gh({ force: true, origin: 'upstream' }));
});