# Deploy Worker

> Deploy Cloudflare Workers to production. Use when deploying main worker, search-consumer, or any Cloudflare Worker.

- Skill: `majiayu000/deploy-worker` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/deploy-worker`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/deploy-worker/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/deploy-worker

---


# Cloudflare Worker Deployment

## Prerequisites
- Ensure CLOUDFLARE_API_TOKEN is set in environment
- Verify wrangler.toml exists in worker directory

## Deployment Steps

### Main Worker
```bash
cd workers/main
npm run build:worker
npx wrangler deploy
```

### Search Consumer Worker
```bash
cd workers/search-consumer
npm run build:consumer
npx wrangler deploy
```

### Verification
After deployment, tail logs to verify:
```bash
timeout 15 npx wrangler tail
```

## Common Issues
- **Authentication failed**: Check CLOUDFLARE_API_TOKEN
- **Build errors**: Run `npm install` first
- **Route conflicts**: Check wrangler.toml routes

## Rollback
If deployment fails:
```bash
npx wrangler rollback
```

