Skip to content
Latchkey

wrangler publish Command Reference

Publish a Cloudflare Worker (legacy alias of wrangler deploy).

wrangler publish was the original command to ship a Cloudflare Worker. In Wrangler v3+ it is an alias for wrangler deploy; new pipelines should use deploy.

What it does

wrangler publish uploads and activates a Worker exactly like wrangler deploy. It remains for backward compatibility with older docs and scripts, but emits a notice steering you toward deploy on current Wrangler versions.

Common flags and usage

  • --env NAME: publish a named environment
  • --name NAME: override the Worker name
  • flags mirror wrangler deploy one-to-one
  • migrate by replacing publish with deploy in your workflow
  • same CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID auth

Example

shell
# Legacy pipeline still on wrangler publish
- name: Publish Worker (legacy)
  env:
    CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
  run: npx wrangler publish --env production
  # Prefer: npx wrangler deploy --env production

In CI

If a pipeline still calls wrangler publish, it works on current Wrangler but you should migrate to wrangler deploy to avoid the deprecation notice and stay aligned with the docs. Auth is identical: CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID from secrets.

Key takeaways

  • wrangler publish is the legacy alias of wrangler deploy.
  • It still works on Wrangler v3+ but emits a deprecation notice.
  • Migrate CI pipelines to wrangler deploy; auth and flags are unchanged.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →