forked from aws-samples/retail-demo-store
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildspec.yml
More file actions
32 lines (30 loc) · 880 Bytes
/
Copy pathbuildspec.yml
File metadata and controls
32 lines (30 loc) · 880 Bytes
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
version: 0.2
env:
parameter-store:
MPARTICLE_API_KEY: "/retaildemostore/webui/mparticle_api_key"
MPARTICLE_SECRET_KEY: "/retaildemostore/webui/mparticle_secret_key"
phases:
install:
runtime-versions:
nodejs: 18
pre_build:
commands:
- echo Installing NPM dependencies...
- cd src/web-ui
- npm ci
build:
commands:
- chmod a+x *.sh
- ./gen_env.sh
- cat .env
- npm run build
post_build:
commands:
- echo Uploading to ${WEB_BUCKET_NAME}
- aws s3 cp --recursive ./dist s3://${WEB_BUCKET_NAME}/
- aws s3 cp --cache-control="max-age=0, no-cache, no-store, must-revalidate" ./dist/index.html s3://${WEB_BUCKET_NAME}/
- aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_DIST_ID} --paths /index.html
artifacts:
files:
- "**/*"
base-directory: src/web-ui/dist