Skip to content

Commit 3501154

Browse files
committed
adding env
1 parent 18112c8 commit 3501154

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ yarn-error.log*
4141
*.tsbuildinfo
4242
next-env.d.ts
4343

44-
# scripts
45-
deploy.sh
46-
4744
# optional: OS/system files
4845
Thumbs.db
4946
.idea/

deploy.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Load environment variables from .env file
5+
export $(grep -v '^#' .env | xargs)
6+
7+
# Build the project
8+
yarn build
9+
10+
# Sync build output to S3
11+
aws s3 sync ./out "s3://$S3_BUCKET/" --delete
12+
13+
# Invalidate CloudFront cache
14+
aws cloudfront create-invalidation --distribution-id "$CLOUDFRONT_DISTRIBUTION_ID" --paths "/*"

0 commit comments

Comments
 (0)