A shell-based static site deployer that crawls a running local website and pushes it to AWS S3 and CloudFront for low-cost, HTTPS-enabled global hosting.
https://github.com/davidbmar/tool-s3-cloudfront-push · public · shipped
A collection of Bash scripts that automate the deployment of dynamic or locally-hosted websites to AWS infrastructure. It converts a running site (e.g., localhost:3000) into static files via crawling, then uploads them to a private S3 bucket served through a CloudFront CDN with Origin Access Control (OAC) for security and HTTPS.
./step0-setup-aws-account.sh ./step1-crawl-site.sh ./step2-create-infrastructure.sh ./step3-deploy.sh
flowchart TD
User[User/Laptop] -->|Runs Scripts| Scripts[Bash Scripts]
Scripts -->|Crawls| LocalSite[Running Website localhost]
LocalSite -->|Static Files| CrawlOutput[crawl-output/]
Scripts -->|Uploads| CrawlOutput
CrawlOutput -->|AWS CLI PutObject| S3[(S3 Bucket Private)]
S3 -->|Origin Access Control| CF[CloudFront Distribution]
CF -->|HTTPS| Visitor[Global Visitors]
The project is built entirely in Shell (Bash). It relies on standard Unix utilities for file handling and the AWS CLI for interacting with Amazon Web Services (S3, CloudFront, IAM). It uses `wget` or similar tools implicitly for the crawling step to generate static copies of dynamic pages.
sequenceDiagram
participant U as User
participant S as Shell Scripts
participant L as Local Site
participant AWS as AWS CLI
participant S3 as S3 Bucket
participant CF as CloudFront
U->>S: Execute step1-crawl-site.sh
S->>L: Request pages/assets
L-->>S: Return HTML/CSS/JS
S->>S: Save to crawl-output/
U->>S: Execute step3-deploy.sh
S->>AWS: Upload files
AWS->>S3: PutObject (Private)
S->>AWS: Create Invalidation
AWS->>CF: Invalidate Cache
CF-->>U: Serve updated content via HTTPS
Use this tool when you have a website running locally (or on a staging server) that you want to publish as a static site with minimal ongoing cost. It is ideal for portfolios, blogs, or documentation sites where server-side processing is not required at runtime, but you want the performance and security of a CDN.
✓ all on main — nothing unmerged.