Skip to content
Back to skills

Netlify Deploy

ASecurity

Deploy web projects to Netlify using the Netlify CLI (`npx netlify`). Use when the user asks to deploy, host, publish, or link a site/repo on Netlify, including preview and production deploys.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 4, 2026
securitybashreactnextjstestinggitapi

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned June 4, 2026

npx -y skills add lidge-jun/cli-jaw-skills --skill netlify-deploy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Netlify Deploy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Netlify Deploy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lidge-jun-netlify-deploy/badge)](https://www.skillsdirectory.com/skills/lidge-jun-netlify-deploy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: netlify-deploy
description: Deploy web projects to Netlify using the Netlify CLI (`npx netlify`). Use when the user asks to deploy, host, publish, or link a site/repo on Netlify, including preview and production deploys.
---

# Netlify Deployment

Deploy web projects to Netlify using the CLI with automatic project detection.

## Prerequisites

- **Netlify CLI**: via npx (no global install required)
- **Authentication**: active Netlify login session
- **Project**: valid web project in current directory

## Workflow

### 1. Verify Authentication

```bash
npx netlify status
```

If not authenticated:

```bash
npx netlify login          # browser-based OAuth (primary)
# OR
export NETLIFY_AUTH_TOKEN=your_token_here  # API key alternative
# Tokens: https://app.netlify.com/user/applications#personal-access-tokens
```

### 2. Link Site

From `netlify status`, check if a site is already linked.

If not linked:

```bash
# Try Git-based linking first
git remote show origin
npx netlify link --git-remote-url <REMOTE_URL>

# If no site exists on Netlify:
npx netlify init
```

`netlify init` guides through team selection, site naming, build settings, and netlify.toml creation.

### 3. Install Dependencies

```bash
npm install  # or yarn/pnpm as appropriate
```

### 4. Deploy

```bash
# Preview deploy (unique URL for testing)
npx netlify deploy

# Production deploy
npx netlify deploy --prod
```

### 5. Report Results

After deployment, report:
- Deploy URL (preview) or Site URL (production)
- Link to deploy logs in Netlify dashboard
- Suggest `netlify open` to view site

## netlify.toml

If present, the CLI uses it automatically. If absent, the CLI prompts for:
- **Build command**: e.g., `npm run build`, `next build`
- **Publish directory**: e.g., `dist`, `build`, `.next`

Common framework defaults:

| Framework | Build Command | Publish Dir |
|-----------|--------------|-------------|
| Next.js | `npm run build` | `.next` |
| React (Vite) | `npm run build` | `dist` |
| Static HTML | (none) | `.` |

Detect framework from `package.json` and suggest appropriate settings.

## Error Handling

| Error | Solution |
|-------|----------|
| "Not logged in" | `npx netlify login` |
| "No site linked" | `npx netlify link` or `npx netlify init` |
| "Build failed" | Check build command, publish dir, dependencies; review build logs |
| "Publish directory not found" | Verify build ran successfully and path is correct |

## Environment Variables

Set secrets in Netlify dashboard (Site Settings → Environment Variables), not in Git.

## Reference

- [Netlify CLI Docs](https://docs.netlify.com/cli/get-started/)
- [netlify.toml Reference](https://docs.netlify.com/configure-builds/file-based-configuration/)
- [CLI commands](references/cli-commands.md)
- [Deployment patterns](references/deployment-patterns.md)
- [netlify.toml guide](references/netlify-toml.md)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…