File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy Frontend to S3 + CloudFront
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ concurrency :
9+ group : deploy-production
10+ cancel-in-progress : true
11+
12+ jobs :
13+ deploy :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+
19+ - name : Setup Node.js
20+ uses : actions/setup-node@v4
21+ with :
22+ node-version : 20
23+ cache : yarn
24+
25+ - name : Install dependencies
26+ run : yarn install --frozen-lockfile
27+
28+ - name : Build
29+ run : yarn build
30+
31+ - name : Configure AWS credentials
32+ uses : aws-actions/configure-aws-credentials@v4
33+ with :
34+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
35+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
36+ aws-region : ${{ secrets.AWS_REGION }}
37+
38+ - name : Sync frontend to S3
39+ run : |
40+ aws s3 sync dist s3://${{ secrets.S3_BUCKET }} --delete
41+
42+ - name : Invalidate CloudFront cache
43+ if : env.COULDFRONT_DIST_ID != ''
44+ env :
45+ COULDFRONT_DIST_ID : ${{ secrets.COULDFRONT_DIST_ID }}
46+ run : |
47+ aws cloudfront create-invalidation \
48+ --distribution-id ${{ env.COULDFRONT_DIST_ID }} \
49+ --paths "/*"
Original file line number Diff line number Diff line change 1+ # Dependencies
2+ node_modules /
3+
4+ # Build output
5+ dist /
6+
7+ # Environment
8+ .env
9+ .env. *
10+
11+ # OS / editor
12+ .DS_Store
13+ * .log
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export const WordleApp = () => {
2323 ( mode === "Dark" ? `bg-[#262B3C] text-white` : "" )
2424 }
2525 >
26+ < h1 > Deploy Test</ h1 >
2627 < div className = "py-10 w-11/12 sm:w-auto" >
2728 { ! isLoading ? (
2829 < >
You can’t perform that action at this time.
0 commit comments