This project can be deployed automatically to AWS S3 and CloudFront through GitHub Actions.
AWS_DEPLOY_ROLE_ARN: IAM role ARN that GitHub Actions assumes through OpenID Connect (OIDC).AWS_REGION: AWS region where the S3 bucket exists.S3_BUCKET_NAME: Target bucket for the static site.CLOUDFRONT_DISTRIBUTION_ID: CloudFront distribution to invalidate after upload.
Create an IAM role that trusts GitHub's OIDC provider and grant it permissions for:
s3:ListBucketon the deployment bucket.s3:PutObjects3:DeleteObjects3:GetObjectcloudfront:CreateInvalidationon the target distribution.
Recommended trust policy conditions should limit access to this repository and branch.
The workflow file is located at .github/workflows/deploy.yml.
It will:
- Run on pushes to
main. - Assume the AWS role using GitHub OIDC.
- Sync the repository contents to the configured S3 bucket.
- Invalidate CloudFront with the path
/*.
This setup uses OIDC authentication (no long-lived AWS keys required). All configuration values are stored as GitHub Secrets.