-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (44 loc) · 1.29 KB
/
deploy.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Deploy
on:
push:
branches:
- deploy
jobs:
build:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
steps:
- name: Checkout source code.
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set environment variables
run: |
echo "REACT_APP_SERVER_URL=${{ secrets.REACT_APP_API_URL }}" >> .env
echo "REACT_APP_KAKAO_URL=${{ secrets.REACT_APP_KAKAO_URL }}" >> .env
- name: Install dependencies
run: |
npm install
- name: Build project
run: |
npm run build
env:
CI: false
- name: Show AWS CLI Version
run: aws --version
- name: Sync S3 Bucket
run: |
aws s3 sync \
build s3://${{secrets.S3_BUCKETS}} \
--delete \
--cache-control "no-cache, no-store, must-revalidate" \
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation \
--distribution-id ${{secrets.CLOUDFRONT_DISTRIBUTION_ID}} \
--paths "/*"