forked from microbit-foundation/cctd-ml-machine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.cjs
53 lines (51 loc) · 1.42 KB
/
deployment.cjs
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
const {
createDeploymentDetailsFromOptions,
} = require('@microbit-foundation/website-deploy-aws-config');
const posixPath = require('path/posix');
const { s3Config } = createDeploymentDetailsFromOptions({
production: {
bucket: 'ml.microbit.org',
mode: 'root',
allowPrerelease: false,
},
staging: {
bucket: 'stage-ml.microbit.org',
},
review: {
bucket: 'review-ml.microbit.org',
mode: 'branch-prefix',
},
});
module.exports = {
deploymentDir: './dist',
...s3Config,
// For non-review versions deploy to the prototype URL
bucketPrefix: s3Config.bucketPrefix ?? 'v/prototype',
region: 'eu-west-1',
removeNonexistentObjects: true,
enableS3StaticWebsiteHosting: true,
errorDocumentKey: 'index.html',
redirects: [],
params: {
'**/**.html': {
CacheControl: 'public, max-age=0, must-revalidate',
},
'**/assets/**': { CacheControl: 'public, max-age=31536000, immutable' },
// There's lots in public/ that we'd ideally use the bundler for to improve caching
'css/**': {
CacheControl: 'public, max-age=0, must-revalidate',
},
'firmware/**': {
CacheControl: 'public, max-age=0, must-revalidate',
},
'imgs/**': {
CacheControl: 'public, max-age=0, must-revalidate',
},
'sounds/**': {
CacheControl: 'public, max-age=0, must-revalidate',
},
'webfonts/**': {
CacheControl: 'public, max-age=0, must-revalidate',
},
},
};