-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (42 loc) · 1.39 KB
/
deploy.yaml
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
name: Deploy to AWS
on:
push:
branches:
- master
# You can authenticate AWS workloads using OIDC.
# @docs https://docs.github.com/ko/enterprise-cloud@latest/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services
permissions:
id-token: write
contents: read
env:
AWS_REGION: ap-northeast-2
AWS_ROLE: arn:aws:iam::755333364809:role/GithubS3Role
UOSLIFE_TOKEN: ${{ secrets.UOSLIFE_TOKEN }}
VITE_BASE_API_URL: ${{ secrets.VITE_BASE_API_URL }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup bun
uses: oven-sh/setup-bun@v1
- name: Install Dependencies
env:
VITE_BASE_API_URL: ${{ env.VITE_BASE_API_URL }}
UOSLIFE_TOKEN: ${{ env.UOSLIFE_TOKEN }}
run: bun install
- name: Build
run: bun run build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE }}
role-session-name: GithubS3RoleSession
- name: Deploy to S3
run: |
aws s3 sync dist/ s3://uoslife-library-recap
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id E358GJ8WE0C9JG --paths "/*"