Skip to content

Commit 8afbe0c

Browse files
authored
Merge pull request #32 from Perry2004/cd/push-to-s3
cd: publish built artifacts to s3
2 parents f5f561a + 4f556bd commit 8afbe0c

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Build artifacts and push to S3
2+
name: Publish to S3
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
contents: read
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
- name: Configure AWS Credentials
17+
uses: aws-actions/configure-aws-credentials@v4
18+
with:
19+
role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN }}
20+
aws-region: ${{ secrets.AWS_REGION }}
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "22"
25+
cache: "yarn"
26+
- name: Install Dependencies
27+
run: yarn install --frozen-lockfile
28+
- name: Build Project
29+
run: yarn build
30+
- name: Deploy to S3
31+
run: |
32+
aws s3 sync ./dist s3://${{ secrets.AWS_S3_BUCKET }} --delete

0 commit comments

Comments
 (0)