Skip to content

Web deploys

You have a build whose output is also a web page, and you want it on a URL. A build can ship as a static site on Cloudflare Workers, straight from the artifacts it already produced.

Creating a deployment

POST /api/projects/{id}/deployments/cloudflare

The deployment names its sourceBuildId. The build's output must contain an index.html; without one the deployment is refused.

What a deployment records

FieldValues
providercloudflare
environmentproduction or preview
statusdraft, queued, deploying, deployed, failed
scriptNameThe Worker script serving the site
urlWhere the site is live
sourceBuildIdThe build the site was made from

Reading deployments

GET /api/projects/{id}/deployments/cloudflare

Status walks draft, queued, deploying, deployed. A deployment that does not arrive lands on failed. url is set once the deployment reaches deployed.

When it fails

  • Refused at creation. The build output has no index.html. Add one to the browser's outputDirectory and rebuild.
  • Status failed. The deploy did not reach Cloudflare or was rejected. Create a new deployment from the same sourceBuildId; the build itself is intact.
  • No url yet. The deployment has not reached deployed. Poll the GET route; queued and deploying are transit states.

Next