-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
62 lines (48 loc) · 1.3 KB
/
Gruntfile.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
module.exports = function (grunt) {
var aws = grunt.file.readJSON(process.env.HOME + '/grunt-aws.json');
var files = [
{ expand: true, cwd: 'css', src: '**', dest: 'css' },
{ expand: true, cwd: 'js', src: '**', dest: 'js' },
{ expand: true, cwd: 'img', src: '**', dest: 'img' },
{ expand: true, cwd: 'photos', src: '**', dest: 'photos' },
{ src: 'index.html', dest: 'index.html' }
];
grunt.initConfig({
aws_s3: {
options: {
accessKeyId: aws.key,
secretAccessKey: aws.secret,
differential: true,
displayChangesOnly: true
},
prod: {
options: {
bucket: aws.prodBucket
},
files: files
},
staging: {
options: {
bucket: aws.stagingBucket
},
files: files
}
},
imagemin: {
photos: {
files: [{
expand: true,
cwd: 'photos-src',
src: [ '*.jpg', '*.JPG' ],
dest: 'photos'
}]
}
}
});
grunt.loadNpmTasks('grunt-aws-s3');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.registerTask('deploy:prod', [ 'aws_s3:prod' ]);
grunt.registerTask('deploy:staging', [ 'aws_s3:staging' ]);
grunt.registerTask('build', [ 'imagemin' ]);
grunt.registerTask('default', 'build');
};