-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
29 lines (22 loc) · 892 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
let gulp = require('gulp');
let clean = require('gulp-clean');
let spawn = require('child_process').spawnSync;
let dotenv = require('dotenv');
dotenv.config();
gulp.task('dev', () => {
spawn("./node_modules/.bin/next", {stdio: 'inherit'});
});
gulp.task('clean', () => {
return gulp.src(['.next', 'dist']).pipe(clean());
});
gulp.task('build', () => {
spawn("./node_modules/.bin/next", ["build"], {stdio: 'inherit'});
});
gulp.task('export', () => {
spawn("./node_modules/.bin/next", ["export", "-o", "dist"], {stdio: 'inherit'});
});
gulp.task('upload', () => {
spawn("aws", ["s3", "rm", process.env.AWS_BUCKET_URI, "--recursive", "--profile", process.env.AWS_PROFILE], {stdio: 'inherit'});
spawn("aws", ["s3", "sync", "dist/", process.env.AWS_BUCKET_URI, "--profile", process.env.AWS_PROFILE], {stdio: 'inherit'});
});
gulp.task('deploy', ['build', 'export', 'upload']);