Architecture of alifyasa.com

Overview

ComponentDescription
Amazon S3Stores static files
Amazon CloudFrontContent Delivery Network
GitHub ActionsContinuous Deployment to Amazon S3

Basic Workflow

  1. I modify the code.
  2. I push to main.
  3. GitHub Actions triggered, built the website and deploy it to S3.
  4. When the CDN cache expires, it will fetch the new one from S3. For now, I can also manually invalidate it, but I’m thinking of a way to automate this.

How GitHub Actions Deploy to S3

Full code here. It simply does this:

npm install
npm run build
aws login
rclone config
rclone sync
invalidate cloudfront cache