forked from OasisDEX/oasis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (32 loc) · 1.03 KB
/
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
34
35
36
37
var exec = require('child_process').exec
var gulp = require('gulp')
var gulpsync = require('gulp-sync')(gulp)
var ghPages = require('gulp-gh-pages')
var surge = require('gulp-surge')
var rename = require('gulp-rename');
// meteor-build-client ../build
gulp.task('build-meteor', function (cb) {
exec('meteor-build-client ../dist --path ""', {cwd: 'frontend'}, function (err, res, failed) {
if (err) {
console.log(err)
} else if (failed) {
process.stdout.write(failed)
} else {
process.stdout.write('\u001b[32mMeteor build completed!\n')
}
cb(err)
})
})
// gh-pages
gulp.task('deploy-gh-pages', function () {
require('fs').writeFileSync('./dist/CNAME', 'oasisdex.com');
return gulp.src('./dist/**/*')
.pipe(ghPages())
})
gulp.task('deploy-surge', [], function () {
return surge({
project: './dist', // Path to your static build directory
domain: 'oasisdex.surge.sh' // Your domain or Surge subdomain
})
})
gulp.task('deploy', gulpsync.sync(['build-meteor', 'deploy-gh-pages']))