Skip to content

Commit 40e0452

Browse files
website github action
1 parent 2b05e54 commit 40e0452

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy Website
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "website/**"
8+
- ".github/workflows/deploy-website.yml"
9+
workflow_dispatch:
10+
11+
permissions:
12+
id-token: write
13+
contents: read
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
env:
19+
AWS_REGION: us-east-1
20+
AWS_S3_BUCKET: capabilitykit.com
21+
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Configure AWS credentials
27+
uses: aws-actions/configure-aws-credentials@v4
28+
with:
29+
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
30+
aws-region: ${{ env.AWS_REGION }}
31+
32+
- name: Deploy to S3
33+
run: aws s3 sync website/ "s3://${AWS_S3_BUCKET}" --delete
34+
35+
- name: Invalidate CloudFront cache
36+
if: env.CLOUDFRONT_DISTRIBUTION_ID != ''
37+
run: aws cloudfront create-invalidation --distribution-id "${CLOUDFRONT_DISTRIBUTION_ID}" --paths "/*"

0 commit comments

Comments
 (0)