Deploy Static Site
deploy_static_siteDeploy a local directory as a static site on Cloudflare Workers, uploading only new files and applying headers/redirects.
Instructions
Deploy a local directory as a static site on Workers (assets-only Worker): builds the file manifest, uploads only files Cloudflare doesn't already have, and deploys. Newly created sites are served on workers.dev. Set not_found_handling to 'single-page-application' for SPAs. _headers/_redirects at the directory root are applied as configuration (not uploaded), and .assetsignore rules (gitignore-style) exclude files from the deploy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| directory | Yes | Path to the built site directory to upload (absolute path recommended) | |
| script_name | Yes | Worker name to deploy the site as (lowercase, alphanumeric and hyphens) | |
| html_handling | No | How HTML URLs are canonicalized (default: auto-trailing-slash) | |
| compatibility_date | No | Worker compatibility date (YYYY-MM-DD); defaults to today | |
| enable_workers_dev | No | Serve the site at <script_name>.<account>.workers.dev. Default: enabled for newly created Workers; existing Workers keep their current setting. | |
| not_found_handling | No | Response when no asset matches: 'single-page-application' serves /index.html (SPA mode), '404-page' serves /404.html (default: none) |