AWS Deployment
This repo builds a static Docusaurus site and publishes it to a shared S3 bucket under public_docs/. The main website CloudFront distribution should route /public_docs* to that bucket/prefix.
High-level setup
- Create an S3 bucket for the site + docs.
- Deploy the website repo to
site/and this repo topublic_docs/in that bucket. - Allow the main website CloudFront distribution to read from
site/*andpublic_docs/*in the bucket (bucket policy). - Update the CloudFront distribution so the default behavior serves the website from
site/and/public_docs*serves docs frompublic_docs/. - Configure GitHub Actions (OIDC role + repo secrets) so pushes to
maindeploy.
Notes
- The site is configured with
baseUrl: "/public_docs/". - The deploy workflow syncs
build/to the bucket prefixpublic_docs/so CloudFront requests map 1:1 to S3 keys. - If you use a CloudFront “pretty URLs” rewrite function, attach it to the
/public_docs*cache behavior so/public_docsand pretty URLs resolve toindex.htmlfiles.
GitHub Actions role (high level)
The deploy workflow needs an IAM role that can:
s3:ListBucketon the shared buckets3:GetObject,s3:PutObject,s3:DeleteObjectonarn:aws:s3:::<shared-bucket>/public_docs/*cloudfront:CreateInvalidationon the main website distribution