Deploy to Netlify

This guide covers deploying with the OpenDeploy CLI to Netlify.

No capability data.

Prerequisites

  • Netlify account and access to the site/team
  • NETLIFY_AUTH_TOKEN set in your environment (CI recommended)

Quick start

bash
# Dry‑run plan (JSON summary only)
opd plan netlify --json --path .

# Deploy (streams logs)
opd deploy netlify --path .

Notes

  • Local automation can prompt or hang depending on Netlify CLI behavior; CI is recommended for reliability.
  • Generate baseline config when needed:
bash
opd config netlify --write --path .

Next.js example

bash
# Prepare config (runtime or legacy plugin is auto-selected when needed)
opd config netlify --write --path apps/web

# Deploy preview
opd deploy netlify --env preview --path apps/web

# Deploy production
opd deploy netlify --env production --path apps/web

Tips:

  • If Prisma migrations are in your build command, the CLI may rewrite netlify.toml to avoid failures during build.
  • Ensure env vars are synced first: opd env sync netlify.

Astro example (static)

bash
opd config netlify --write --path .
opd deploy netlify --path .

CI usage

bash
opd plan netlify --env production --json --path . > plan.json
opd deploy netlify --env production --path .

Troubleshooting

  • Hanging during link/deploy locally: prefer CI or use the API-based linking flows.
  • Build fails on monorepo root: pass --path to the app folder (e.g., apps/web).
  • Missing env vars: run opd env sync netlify before deploy.