Deploy a Brittek Digital project to Cloudflare via Wrangler — runs D1 migrations, deploys Worker/Pages, runs post-deploy smoke check. Invoke with project name: /deploy-brittek brittek-digital https://brittek.net
---
name: deploy-brittek
description: Deploy a Brittek Digital project to Cloudflare via Wrangler — runs D1 migrations, deploys Worker/Pages, runs post-deploy smoke check. Invoke with project name: /deploy-brittek brittek-digital
disable-model-invocation: true
---
# Deploy Brittek
## Usage
`/deploy-brittek <project>` — e.g. `/deploy-brittek brittek-surface`
## Steps (run in order, stop on any failure)
### 1. Preflight
```bash
# Confirm wrangler is authenticated
wrangler whoami
# Confirm clean working tree
git status --short
```
### 2. D1 Migrations
```bash
# List pending migrations
wrangler d1 migrations list <DB_NAME> --remote
# Apply
wrangler d1 migrations apply <DB_NAME> --remote
```
### 3. Build
```bash
pnpm run build
```
### 4. Deploy
```bash
wrangler deploy
```
### 5. Post-Deploy Smoke Check
```bash
# Hit the health endpoint — expect 200
curl -s -o /dev/null -w "%{http_code}" https://<PROJECT>.brittek.digital/api/health
```
## Abort Rules
- Non-zero exit at any step → STOP, report failure, do NOT proceed
- `git status` shows uncommitted changes → STOP, require clean tree first
- Smoke check returns non-200 → flag for immediate rollback via `wrangler rollback`
## Notes
- Use `pnpm` only — no npm/yarn
- DB_NAME comes from `wrangler.toml` `[[ d1_databases ]]` binding
- Never deploy with `.env` changes uncommitted to Cloudflare secrets (`wrangler secret put`)
don't have the plugin yet? install it then click "run inline in claude" again.