-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildspec.yml
41 lines (39 loc) · 1.33 KB
/
buildspec.yml
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
version: 0.1
phases:
pre_build:
commands:
- echo Installing source NPM dependencies...
- npm install
- echo updating apiUrl in env.js ...
build:
commands:
- echo Build started on `date`
- npm run build
post_build:
commands:
# copy the contents of /build/es6-bundled to S3
- >
aws s3 cp
--cache-control="max-age=0, no-cache, no-store, must-revalidate"
--recursive ./build/es6-bundled s3://$DEPLOY_BUCKET/
# set the cache-control headers for service-worker.js to prevent
# browser caching
- >
aws s3 cp
--cache-control="max-age=0, no-cache, no-store, must-revalidate"
./build/es6-bundled/service-worker.js s3://$DEPLOY_BUCKET/
# set the cache-control headers for index.html to prevent
# browser caching
- >
aws s3 cp
--cache-control="max-age=0, no-cache, no-store, must-revalidate"
./build/es6-bundled/index.html s3://$DEPLOY_BUCKET/
# invalidate the CloudFront cache for index.html and service-worker.js
# to force CloudFront to update its edge locations with the new versions
# - >
# aws cloudfront create-invalidation --distribution-id $DISTRIBUTION
# --paths /index.html /service-worker.js
artifacts:
files:
- '**/*'
base-directory: build