-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.17 KB
/
push-artifacts.yaml
File metadata and controls
43 lines (43 loc) · 1.17 KB
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
# Build artifacts and push to S3
name: Publish to S3
on:
push:
branches:
- main
paths-ignore:
- scripts/**
- README.md
- .github/workflows/**
workflow_dispatch:
jobs:
push-artifacts-to-s3:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "yarn"
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build Project
run: yarn cibuild
- name: Deploy to S3
run: |
aws s3 sync ./dist s3://${{ vars.AWS_S3_BUCKET }}/website --delete
- name: Invalidate CloudFront cache
uses: foxdalas/cloudfront-invalidator@v4
with:
tag_key: "Name"
tag_value: ${{ vars.CLOUDFRONT_DISTRIBUTION_NAME }}
paths: "/*"