-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (34 loc) · 1020 Bytes
/
main.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
name: Deploy furd.dev to S3
on:
push:
branches:
- main
paths-ignore:
- 'infra/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy_to_s3:
name: Deploy furd.dev to S3
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: 🛒 Checkout
uses: actions/checkout@v3
- name: ⚙️ Setup
run: |
npm install
npm run build
- name: ✅ Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.GH_ACTION_ROLE_ARN }}
role-session-name: github-cd
aws-region: us-west-1
- name: 🚀 Deploy to S3
run: aws s3 sync --delete ./dist/ s3://${{ secrets.SITE_BUCKET }}/
- name: 🧼 Invalidate CloudFront cache
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRO_ID }} --paths "/*"