File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 "/*"
You can’t perform that action at this time.
0 commit comments