Skip to content

Commit 74dc0f0

Browse files
committed
chore: 배포파일 추가
1 parent 4d1a865 commit 74dc0f0

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy to S3 and invalidate CloudFront
2+
on:
3+
push:
4+
branches: [main]
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Setup Node
13+
uses: actions/setup-node@v2
14+
with:
15+
node-version: "18"
16+
17+
- name: Install dependencies
18+
run: npm ci
19+
20+
- name: Build
21+
run: npm run build
22+
env:
23+
VITE_API_SERVER_URL: ${{ secrets.VITE_API_SERVER_URL }}
24+
25+
- name: Configure AWS credentials
26+
uses: aws-actions/configure-aws-credentials@v1
27+
with:
28+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
29+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
30+
aws-region: ap-northeast-2
31+
32+
- name: Deploy to S3
33+
run: aws s3 sync dist/ s3://solid-connection-admin --delete
34+
35+
- name: Invalidate CloudFront
36+
run: |
37+
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"

0 commit comments

Comments
 (0)