# Deploy

## Environments

| Env | Branch | URL |
|-----|--------|-----|
| Staging | `dev` | https://dev.ficarra.app |
| Production | `main` | https://ficarra.app |

Fallback while DNS settles: https://ficarra-dev.vercel.app

## Staging (default)

```powershell
# from repo root, on branch dev
npx vercel --yes
npx vercel alias set <deployment-url> dev.ficarra.app
# fallback:
# npx vercel alias set <deployment-url> ficarra-dev.vercel.app
```

GitHub pushes to `dev` can also create preview deployments; re-point the stable alias after meaningful previews.

## Production

Only when explicitly shipping:

```powershell
npx vercel --prod --yes
```

Or merge/push to `main` if production is linked to that branch.

## Staging DNS (`dev.ficarra.app`)

In Porkbun for `ficarra.app`, the `dev` hostname must point at Vercel — **not** URL forwarding / `pixie.porkbun.com`.

Recommended records (either option):

1. **A record:** host `dev` → `76.76.21.21`
2. **or CNAME:** host `dev` → `cname.vercel-dns.com`

Remove any Porkbun “URL Forward” on `dev` first (that creates the `pixie.porkbun.com` CNAME and blocks Vercel certificates).

After DNS propagates:

```powershell
npx vercel alias set <latest-preview-url> dev.ficarra.app
```

## Add a project

1. Put files in `projects/<slug>/` (include `index.html`)
2. Add an entry to `projects.json`
3. Add `<slug>` to **both** rewrite patterns in `vercel.json`
4. Deploy to staging first; production only when asked
