← ClaudeAtlas

cloudflare-deploylisted

Set up and deploy Astro websites to Cloudflare Workers with custom domains. Use this skill when the user wants to deploy a site to Cloudflare, set up Cloudflare Pages/Workers, configure wrangler.toml, add a custom domain, fix deployment issues, troubleshoot DNS for a Cloudflare-hosted site, or verify a deployment is working. Also use when you see @astrojs/cloudflare, wrangler.toml, or .workers.dev in the project.
rvanbaalen/skills · ★ 0 · DevOps & Infrastructure · score 58
Install: claude install-skill rvanbaalen/skills
# Deploy Astro Site to Cloudflare Workers Guide for setting up and deploying Astro sites to Cloudflare Workers with custom domains. This encodes tested patterns that avoid common pitfalls. ## Critical Rule **Never run `wrangler deploy` or `wrangler pages deploy` locally.** Deployments happen by pushing to git. The CI/CD pipeline (Cloudflare dashboard connected to GitHub) handles the rest. Local deploys create version drift and bypass any CI checks. The only local wrangler commands you should run are diagnostic/read-only ones like `wrangler whoami`, `wrangler deployments list`, and `wrangler dev` (local preview). ## Setup Checklist Work through these steps in order. Each step has a verification check. ### 1. Install the Cloudflare Adapter ```bash npm install @astrojs/cloudflare ``` Astro 6 also requires an explicit Vite 7 dependency to avoid build errors (`require_dist is not a function`): ```bash npm install vite@^7 ``` **Verify:** `package.json` has both `@astrojs/cloudflare` and `vite: "^7"` in dependencies. ### 2. Configure astro.config.mjs The adapter should only activate for builds, not during local dev. Use this conditional pattern: ```js import { defineConfig } from 'astro/config'; import tailwindcss from '@tailwindcss/vite'; import cloudflare from '@astrojs/cloudflare'; export default defineConfig({ site: 'https://your-domain.example.com', adapter: process.argv.includes('dev') ? undefined : cloudflare(), vite: { plugins: [tailwindcss()], },