Deploy a site

Build a site in GitHub Actions and put it live in your Cloudflare account.

Select Deploy on the site page. Fleet builds the site in your repository and puts it live in your Cloudflare account.

Before you start

  • You are a Developer, Admin or Owner, or your custom role holds deploys:write. See Roles and permissions.
  • A deploy starts only when you trigger it, with Deploy or with Create when the checkbox "Deploy the site as soon as it is set up" was selected. Fleet never configures a build on push.
  • Fleet deploys sites it created. It never writes to a linked site, so a linked site has no Deploy. Use your own pipeline.
  • The site is Ready to deploy, Active or Setup not finished. A site that is Deploying or Migrating holds another job, so a new deploy waits for it.
  • The repository holds the workflow fleet-build.yml that Fleet wrote when it created the site, enabled in GitHub.

Steps

  1. Open the site on the Sites tab.
  2. If the site shows Connection needs reconnecting, select Reconnect. Fleet refuses a deploy until the connection works.
  3. Select Deploy and confirm.
  4. Follow the job page. Fleet records a recovery point of the database, builds in your repository for up to 30 minutes, uploads the version and puts it live.
  5. Wait until the job ends. Fleet checks the site's health for up to 10 minutes.
  6. Open the site and check it. After a first deploy, select Open admin and finish the EmDash setup.
Confirming a deploy of the site in the Deploy dialog on the site page.

Result

If something goes wrong

The job page shows one of these messages. Open the run in GitHub to read a build log.

The build workflow fleet-build.yml is missing or disabled in this repository. Add it as the Fleet documentation describes or enable it under Actions in GitHub, then deploy again.

The build failed in GitHub Actions. Open the run to read the log, fix the repository, then deploy again.

GitHub Actions did not start or finish the build within 30 minutes. Nothing was deployed. Deploy again, or open the Actions tab of the repository.

The build output failed Fleet's safety checks and was not deployed. Run the deploy again. If it fails again, contact support and quote job <id>.

The built Worker is larger than Cloudflare allows (64 MiB before compression, on Workers Free and Workers Paid). Reduce the bundle.

The site did not answer its health check after the deploy. Roll back to the previous version, check the log, or fix the repository and deploy again.

A large database needs its migration on the command line. The command does not read a .env file, so set both variables in your shell. See EmDash's core migrations guide.

EmDash needs its command-line migration for a database of this size. Put a Cloudflare API token that may edit D1 in `CLOUDFLARE_API_TOKEN` and the site's Cloudflare account ID in `CLOUDFLARE_ACCOUNT_ID`. In the site's repository run `npm run build`, then `npx emdash migrate --wrangler-config wrangler.jsonc`, or `npx emdash migrate --d1` followed by the name of the site's D1 database. Confirm the target it shows, as the EmDash core migrations documentation describes, then deploy again.

The build uses the GitHub Actions allowance of the repository owner. If GitHub has used up the included Actions compute, it blocks the run and nothing is deployed. Check usage on GitHub's billing page for Actions. See Builds and the GitHub Actions allowance.

For more causes, see Deploy failed and The build failed or did not finish. Never send a token, a password or an API key to support.

Related

Report a problem with this page