Docs/Deploying to Cloudflare Workers

Deploying to Cloudflare Workers

Deploy your Astro site to Cloudflare Workers with PhantomWP.

Deploying to Cloudflare Workers

Cloudflare deploys through Workers for PhantomWP repositories. This supports server-mode Astro projects, WooCommerce, and API routes.

Connect Cloudflare

  1. Create a Cloudflare API token with Account Settings read, Workers Scripts edit, and Workers KV Storage edit access.
  2. Open the PhantomWP dashboard.
  3. Connect Cloudflare from the deployment provider card.
  4. If your token can access more than one account, enter the Cloudflare account ID.

PhantomWP stores the account ID as Cloudflare provider metadata and uses it for Workers API calls.

Deploy A Repository

Open the project menu and deploy to Cloudflare Workers. PhantomWP configures:

  • @astrojs/cloudflare
  • wrangler.jsonc
  • A GitHub Actions workflow that runs npm run build and npx wrangler deploy
  • GitHub repository secrets for Cloudflare credentials and deployment env vars

GitHub Actions must be enabled for the repository. PhantomWP commits the Cloudflare setup files to GitHub during deployment. If your local editor was open before deployment, pull from GitHub before your next push so your local branch includes those setup commits.

Environment Variables

PhantomWP stores WordPress and WooCommerce environment variables as GitHub Actions secrets. Redeploy after changing settings.

Domains

Use the Cloudflare Workers dashboard to add a custom domain or route. PhantomWP's in-app domain panel currently supports Vercel domains only.