Deploy an AI-Built Static Website for Free
Deploy your frontend-only AI-built website for free with Cloudflare Workers, get a live URL, and optionally connect your own domain.
Roadmap & Resources
Check If Your Website Can Use Static Hosting
Review the Project for Static Hosting
Before deploying, make sure the project does not require a server runtime. Use your AI coding assistant to check it.
Static Hosting Review
Identifies the framework, package manager, production build command, build output directory, whether the project is genuinely frontend-only, the frontend environment variables and any external services, checks that the project can run entirely as static files with no secrets exposed in client-side code, and reports whether static hosting is the correct deployment method.
Review this project specifically for static production hosting. Identify: - the framework and project type - the package manager - the production build command - the build output directory - whether the project is fully frontend-only - whether it uses API routes, Server Actions, server-side rendering, backend code, or another server runtime - every environment variable used by the frontend — names only - any authentication, database, API, storage, or external services Check that: - the project can run entirely as static files in production - the production build succeeds - no private API keys, secrets, or server-only credentials are exposed in client-side code - client-side routing can work correctly on static hosting Do not deploy anything yet. Finish with: 1. whether the project is suitable for static hosting 2. the production build command 3. the build output directory 4. anything I need to fix before deployment If the project requires a real server runtime, tell me clearly that static hosting is not the correct deployment method.
IMPORTANT
Continue only if the project is suitable for static hosting. If the project requires a real server runtime, static hosting is not the correct deployment method for it.
Cloudflare Workers can serve HTML, CSS, JavaScript, images, and other static assets directly across Cloudflare's network. Static asset requests are currently free and unlimited.
Push the Project to GitHub
Create the Repository and Push Your Project
Create a GitHub repository for the website if you do not already have one, then push the production-ready project.
Confirm the repository includes:
Source files
package.json if used
The correct lockfile
Framework configuration
Public/static assets
IMPORTANT
Do not commit private .env files or secret values.
You'll connect this repository to Cloudflare so future pushes can automatically trigger new deployments.
Deploy the Website for Free
Open Cloudflare Workers
This tutorial uses Cloudflare Workers to host the static website at no cost.
Deploy With Cloudflare Workers
Host your static website for free and automatically publish future updates from GitHub.
FREE HOSTING USED IN THIS TUTORIAL
https://dash.cloudflare.com/
Import the Repository and Deploy
Then in Cloudflare:
Workers & Pages Create application Import a repository
Connect your GitHub account Select the repository from Step 2 Configure the build settings using the values from Step 1 Deploy the website
Cloudflare's current Workers Git integration supports GitHub repositories and automatically builds and deploys again when you push new changes.
Enter Your Build Settings
For a typical React/Vite website, the settings may be similar to:
Build command
npm run build
Static assets directory
dist
IMPORTANT
Use the actual values detected for your project rather than assuming these defaults.
Once deployment finishes, Cloudflare gives the website a free URL on a subdomain of:
Free Cloudflare URL
*.workers.dev
Test the Website and Add Your Domain
Test the Live Website
Open the free Cloudflare URL and test the production website.
Verify:
The homepage loads
Important pages and routes work
Direct page visits and refreshes work
CSS, JavaScript, fonts, and images load
Forms work where applicable
External APIs work
No private secrets are exposed in frontend code
HTTPS is active
Optional — Connect Your Own Domain
The free workers.dev URL is enough to keep the website online at no hosting cost.
If you want a professional domain, you need to own that domain separately.
Example custom domain
yourwebsite.com
Then open your Worker in Cloudflare and add it as a Custom Domain.
Cloudflare can create the required DNS records and certificates automatically when the domain is in an active Cloudflare zone.
Updating It Later
Keep editing the project normally and push production-ready changes to GitHub.
Your workflow becomes Project → GitHub → Cloudflare Workers.
Cloudflare can automatically rebuild and publish the new version after each push to the connected repository.