-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildspec.yml
More file actions
40 lines (38 loc) · 1.73 KB
/
buildspec.yml
File metadata and controls
40 lines (38 loc) · 1.73 KB
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
version: 0.2
phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- echo Build started on `date`
- echo Installing dependencies...
- npm ci
- echo Retrieving environment variables from Parameter Store...
- export VITE_SOCIAL_AUTH_URL=$(aws ssm get-parameter --name "/harudew/VITE_SOCIAL_AUTH_URL" --query "Parameter.Value" --output text)
- export VITE_GOOGLE_MAPS_API_KEY=$(aws ssm get-parameter --name "/harudew/VITE_GOOGLE_MAPS_API_KEY" --with-decryption --query "Parameter.Value" --output text)
- export VITE_REDIRECT_URI=$(aws ssm get-parameter --name "/harudew/VITE_REDIRECT_URI" --query "Parameter.Value" --output text)
- export VITE_VAPID_PUBLIC_KEY=$(aws ssm get-parameter --name "/harudew/VITE_VAPID_PUBLIC_KEY" --query "Parameter.Value" --output text)
- echo Environment variables loaded successfully
- echo "=== Environment Variables Debug ==="
- echo "VITE_SOCIAL_AUTH_URL = $VITE_SOCIAL_AUTH_URL"
- echo "VITE_GOOGLE_MAPS_API_KEY = [HIDDEN]"
- echo "VITE_REDIRECT_URI = $VITE_REDIRECT_URI"
- echo "VITE_VAPID_PUBLIC_KEY = $VITE_VAPID_PUBLIC_KEY"
- echo "All VITE_ variables:"
- printenv | grep VITE || echo "No VITE_ variables found"
- echo "=== End Debug ==="
build:
commands:
- echo Build started on `date`
- echo Building the React application...
- npm run build
post_build:
commands:
- echo Build completed on `date`
- echo Uploading to S3...
- aws s3 sync dist/ s3://harudew.site --delete
- echo Invalidating CloudFront cache...
- aws cloudfront create-invalidation --distribution-id E264KENN1EBLKD --paths "/*"
artifacts:
files:
- '**/*'
base-directory: dist