All skills
openai avatar

/netlify-deploy

@bf9e226 official
by openaiopenai/skills28k stars
1,891

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.

Use this Skill: https://skilld.dev/gh/openai/skills/netlify-deploy

This session only. Nothing lands on disk.

referencesnetlify-toml.md

≈993 tokens on demand. Your agent reads this file only when SKILL.md points to it.

netlify.toml Configuration Reference

Configuration file for Netlify builds and deployments.

Basic Structure

[build]
  command = "npm run build"
  publish = "dist"

Build Settings

Common Configuration

[build]
  # Command to build your site
  command = "npm run build"

  # Directory to publish (relative to repo root)
  publish = "dist"

  # Functions directory
  functions = "netlify/functions"

  # Base directory (if not repo root)
  base = "packages/frontend"

  # Ignore builds for specific conditions
  ignore = "git diff --quiet HEAD^ HEAD package.json"

Environment Variables

[build.environment]
  NODE_VERSION = "18"
  NPM_FLAGS = "--prefix=/dev/null"

[context.production.environment]
  NODE_ENV = "production"

Framework Detection

Netlify auto-detects frameworks, but you can override:

Next.js

[build]
  command = "npm run build"
  publish = ".next"

React (Vite)

[build]
  command = "npm run build"
  publish = "dist"

Vue

[build]
  command = "npm run build"
  publish = "dist"

Astro

[build]
  command = "npm run build"
  publish = "dist"

SvelteKit

[build]
  command = "npm run build"
  publish = "build"

Redirects and Rewrites

[[redirects]]
  from = "/old-path"
  to = "/new-path"
  status = 301

[[redirects]]
  from = "/api/*"
  to = "https://api.example.com/:splat"
  status = 200

# SPA fallback (for client-side routing)
[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

Headers

[[headers]]
  for = "/*"
  [headers.values]
    X-Frame-Options = "DENY"
    X-XSS-Protection = "1; mode=block"
    Content-Security-Policy = "default-src 'self'"

[[headers]]
  for = "/assets/*"
  [headers.values]
    Cache-Control = "public, max-age=31536000, immutable"

Context-Specific Configuration

Deploy different settings per context:

# Production
[context.production]
  command = "npm run build:prod"
  [context.production.environment]
    NODE_ENV = "production"

# Deploy previews
[context.deploy-preview]
  command = "npm run build:preview"

# Branch deploys
[context.branch-deploy]
  command = "npm run build:staging"

# Specific branch
[context.staging]
  command = "npm run build:staging"

Functions Configuration

[functions]
  directory = "netlify/functions"
  node_bundler = "esbuild"

[[functions]]
  path = "/api/*"
  function = "api"

Build Plugins

[[plugins]]
  package = "@netlify/plugin-lighthouse"

  [plugins.inputs]
    output_path = "reports/lighthouse.html"

[[plugins]]
  package = "netlify-plugin-submit-sitemap"

  [plugins.inputs]
    baseUrl = "https://example.com"
    sitemapPath = "/sitemap.xml"

Edge Functions

[[edge_functions]]
  function = "geolocation"
  path = "/api/location"

Processing

[build.processing]
  skip_processing = false

[build.processing.css]
  bundle = true
  minify = true

[build.processing.js]
  bundle = true
  minify = true

[build.processing.html]
  pretty_urls = true

[build.processing.images]
  compress = true

Common Patterns

Single Page Application (SPA)

[build]
  command = "npm run build"
  publish = "dist"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

Monorepo with Base Directory

[build]
  base = "packages/web"
  command = "npm run build"
  publish = "dist"

Multiple Redirects with Country-Based Routing

[[redirects]]
  from = "/"
  to = "/uk"
  status = 302
  conditions = {Country = ["GB"]}

[[redirects]]
  from = "/"
  to = "/us"
  status = 302
  conditions = {Country = ["US"]}

Validation

Validate your netlify.toml:

npx netlify build --dry

Resources

Source: SKILL.md on GitHub

1 warning17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    This skill automates web project deployments to Netlify using the Netlify CLI. It includes routine security considerations such as executing local build commands and requesting escalated network permissions when required by the environment. These actions are aligned with the skill's intended purpose of hosting and publishing web content. See the detailed analysis for a breakdown of these operational patterns.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    6/6 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at bf9e226. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Activeupdated 8 months ago
  • CLI
  • netlify
  • deployment
  • hosting
  • web
  • preview-deploy
  • production-deploy
  • netlify-cli

README badge

README badge for openai/skills/netlify-deploy

Deploys web projects to Netlify using the Netlify CLI, handling authentication, site linking, and build configuration detection. Covers preview and production deploys, and works with any framework that has a build command and publish directory.

Generated from the current SKILL.md.

Does this skill require a global Netlify CLI install?
No. The skill uses npx netlify, which downloads and runs the CLI on-demand without requiring a global installation.
What authentication methods does this skill support?
Browser-based OAuth via netlify login (primary) and API key authentication via the NETLIFY_AUTH_TOKEN environment variable.
Can this skill deploy to production and preview environments?
Yes. Use npx netlify deploy for preview/draft deploys and npx netlify deploy --prod for production deployments to the live site URL.
What happens if the project isn't linked to a Netlify site?
The skill attempts to link by Git remote URL, or falls back to npx netlify init to create a new site interactively.
What should I do if deployment fails due to network restrictions?
Rerun the deploy command with sandbox_permissions=require_escalated to grant the skill escalated network access for outbound requests to Netlify.

Generated from the current SKILL.md. These answers refresh after source changes.