-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
27 lines (26 loc) · 994 Bytes
/
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
version: 0.2
phases:
install:
runtime-versions:
nodejs: 20
commands:
# - npm i npm@latest -g
# - pip install --upgrade pip
# - pip install --upgrade awscli
- echo Ready
pre_build:
commands:
- printenv
- echo `date +%s` > timestamp
- echo Build started on `date`
- npm cache verify
- npm install
build:
commands:
- npm run generate
post_build:
commands:
- aws s3 sync --cache-control max-age=60480000,public --delete ./dist $S3_BUCKET
- aws s3 cp $S3_BUCKET $S3_BUCKET --exclude '*' --include 'sw.js' --metadata-directive REPLACE --acl public-read --cache-control 'no-cache, no-store' --recursive
- aws s3 cp $S3_BUCKET $S3_BUCKET --exclude '*' --include '*.html' --metadata-directive REPLACE --acl public-read --cache-control 'no-cache, no-store' --content-type 'text/html' --recursive
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_ID --paths "/*"