Deploy a site to Cloudflare

@codify/cloudflare-site·Codify official·v1.0.0·Updated yesterday

Put a new or existing site online for free on a workers.dev URL. No domain or server needed: Node, wrangler, login and deploy in one step.

0 appliesmacOS · Linux
Apply with CodifyCustomize a copy

Opens the template in the Codify dashboard. Applying doesn't create a setup; customizing makes a private copy you can edit.

Or from your terminal
curl -fsSL https://releases.codifycli.com/ensure.sh | bash && codify apply @codify/cloudflare-site
Installs Codify first if you don’t have it.

Configuration

The exact file codify apply uses. Copy it into your own codify.jsonc, or download it.

codify.jsonc108 lines · 2.5 KB
[
{
"type": "variable",
"name": "siteSource",
"valueType": "enum",
"label": "What do you want to deploy?",
"options": [
"new",
"existing"
],
"default": "new"
},
{
"type": "variable",
"name": "framework",
"valueType": "enum",
"label": "Which framework should the new site use?",
"description": "\"static\" is plain HTML, CSS and JavaScript with no build step.",
"options": [
"static",
"astro",
"react",
"vue",
"svelte",
"next",
"nuxt",
"hono"
],
"default": "astro",
"when": {
"siteSource": "new"
}
},
{
"type": "variable",
"name": "projectRepository",
"label": "Git URL of your site",
"description": "HTTPS URLs work without an SSH key. Ex: https://github.com/you/site.git",
"when": {
"siteSource": "existing"
}
},
{
"type": "variable",
"name": "workerName",
"label": "Site name",
"description": "Lowercase letters, numbers and dashes. Your site will be at https://<site name>.<your subdomain>.workers.dev",
"default": "my-site"
},
{
"type": "variable",
"name": "projectDirectory",
"label": "Where should the project live?",
"default": "~/projects/my-site"
},
{
"type": "nvm",
"nodeVersions": [
"lts"
],
"global": "lts"
},
{
"type": "wrangler"
},
{
"type": "wrangler-auth"
},
{
"type": "git-repository",
"name": "site",
"repository": "${{ projectRepository }}",
"directory": "${{ projectDirectory }}",
"when": {
"siteSource": "existing"
}
},
{
"type": "project-install",
"directory": "${{ projectDirectory }}",
"when": {
"siteSource": "existing"
}
},
{
"type": "cloudflare-worker",
"workerName": "${{ workerName }}",
"directory": "${{ projectDirectory }}",
"framework": "${{ framework }}",
"when": {
"siteSource": "new"
}
},
{
"type": "cloudflare-worker",
"workerName": "${{ workerName }}",
"directory": "${{ projectDirectory }}",
"when": {
"siteSource": "existing"
}
},
{
"type": "notice",
"level": "success",
"title": "Your site is live on Cloudflare",
"message": "`${{ workerName }}` is deployed: the URL is printed above (https://${{ workerName }}.<your-subdomain>.workers.dev).\n\nWork on it locally: `cd ${{ projectDirectory }} && npx wrangler dev`\nShip changes: `npx wrangler deploy`\n\nNo domain, no server, no bill (the free plan is plenty for a personal site)."
}
]
Deploy a site to Cloudflare: Codify setup template | Codify