-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (35 loc) · 1.08 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
38
39
'use strict';
var gulp = require('gulp');
var AWS = require('aws-sdk');
var awspublish = require("gulp-awspublish");
var awspublishRouter = require("gulp-awspublish-router");
gulp.task('deploy', function(cb) {
var publisher = awspublish.create({
region: 'us-west-2',
params: {
Bucket: 'buttonjoy.com'
}
});
var headers = {
'Cache-Control': 'private, max-age=0, no-cache'
};
return gulp.src('site/**/**')
.pipe(awspublishRouter({
cache: {
// cache for 5 minutes by default
cacheTime: 300
},
routes: {
"^about$": { headers: { "Content-Type": "text/html" } },
"^index$": { headers: { "Content-Type": "text/html" } },
"^charity$": { headers: { "Content-Type": "text/html" } },
"^faq$": { headers: { "Content-Type": "text/html" } },
"^partnerships$": { headers: { "Content-Type": "text/html" } },
"^setup$": { headers: { "Content-Type": "text/html" } },
"^.+$": "$&"
}
}))
.pipe(publisher.publish())
.pipe(publisher.sync())
.pipe(awspublish.reporter());
});