
netlify-deploy
Create, configure, and manage Netlify deploys from code — reach for this when setting up Git continuous deployment, running netlify deploy or netlify deploy --prod from the CLI, writing netlify.toml deploy contexts, adding a Deploy to Netlify button, wiring build hooks, configuring Deploy Previews or branch deploys, locking or skipping deploys, fixing a failed or secrets-scanning deploy, or when someone asks to "deploy my site", "set up preview deploys", "add per-branch build config", "keep staging out of Google", or "add a deploy button to my README".
- Installs
- 3.4K
- Last 24h
- +28
- Trending rank
- #4553
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/netlify/context-and-tools --skill netlify-deploy- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads netlify-deploy automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Netlify deploy
Modern CLI
netlify deploy # manual draft deploy (no CI)
netlify deploy --prod # deploy straight to production
netlify create # new project from a natural-language prompt
netlify deploy --allow-anonymous # temp project, claim within 1 hour
npm update -g netlify-cli # skew protection needs 23.11.0+
A deploy is a versioned, atomic snapshot: Netlify uploads only changed files and switches the live site only after all files land — the site is never in an inconsistent state. A deploy can be a preview or a production version served at your primary domain.
Continuous deployment vs manual deploys: Deploy with Git and the Netlify CLI support continuous deployment — a push auto-triggers a build. Drag and drop and the API create one-off manual deploys. Manual deploys (netlify deploy) do not run a build command; drag-and-drop while logged in is the only exception (framework auto-detected).
⚠ When linking or creating a site, add .netlify to .gitignore. Every linking path writes .netlify/state.json, which must not be committed.
Ways to create a deploy
- Git CD — connect a repo; Netlify builds and deploys on every push (OAuth2 or the Netlify GitHub App). This is the default path. Production deploys come from pushes to the production branch — often the repo's default branch (e.g.
main), changeable under Branches and deploy contexts. - CLI —
netlify create,netlify deploy,netlify deploy --prod. - Drag and drop — https://app.netlify.com/drop. Logged in: builds if needed. Not logged in: publishes files as-is.
- API — create deploys via file digest or ZIP (one-off manual).
- Deploy to Netlify button — one-click from a public template repo.
- Build hooks — unique URLs that trigger builds. (Deploys from build hooks are treated as trusted and bypass the deploy request policy.)
- AI agents — Agent Runners (Claude Code, OpenAI Codex, Google Antigravity) from the dashboard; every file-changing run auto-generates a Deploy Preview at
agent-<runID>--<site>.netlify.app. The inline preview shown next to the prompt is the same Deploy Preview available at that URL. - Zapier / n8n — automation integrations.
Not sure which path? The Deploy Navigator gives personalized recommendations: https://docs.netlify.com/start/choose-your-path#deploy-navigator (also embedded on the create-deploys page as "Not sure where to start?").
netlify.toml deploy contexts
At the repo root. File config overrides UI settings. Five predefined contexts: production, deploy-preview, branch-deploy, preview-server, dev. Branch names also work as custom contexts; more specific contexts override general ones.
[context.production]
command = "make production"
[context.production.environment]
ACCESS_TOKEN = "super secret"
[[context.production.plugins]] # plugins REQUIRE double brackets
package = "@netlify/plugin-sitemap"
[context.deploy-preview.environment]
ACCESS_TOKEN = "not so secret"
[context.branch-deploy] # all branch deploys
command = "make staging"
[context.staging] # one branch; overrides branch-deploy
command = "npm run build:staging-special"
[context.dev.environment]
NODE_ENV = "development"
[context."features/branch"] # quote slashed branch names
command = "gulp"
⚠ Environment variables set in netlify.toml are NOT available to the deploy environment — set them via UI/CLI/API. netlify.toml is committed, so keep sensitive values out of it; use per-context env vars via UI/CLI/API instead.
See references/netlify-toml.md for the full context precedence rules and references/deployment-patterns.md for context strategy.
Deploy Previews & branch deploys
- Deploy Previews auto-build for PRs/MRs (GitHub, GitLab, Bitbucket, Azure DevOps, Cursor Origin) and agent runs. The base branch must be a production branch or a branch-deploy-enabled branch. URL:
deploy-preview-<num>--<site>.netlify.app. While the first deploy is pending the URL returnsNot Found. - Branch deploys require setup: Project configuration > Developer settings > Continuous deployment > Branches and deploy contexts > Configure. Enable specific branches (prefix wildcard
features/*supported) or All new branches. URL:<branch>--<site>.netlify.app. A branch deploy persists as long as the branch exists. Build settings/env vars:[context.branch-deploy]for all branches,[context.<branch>]for one. - A branch-deploy branch with an open PR yields both a Deploy Preview and a branch deploy.
- Entry path: put
@netlify /some/pathin the PR/MR description, then push a new commit to regenerate. Once set in the PR, you can't change it in the Netlify Drawer. - Skip a deploy:
[skip ci]or[skip netlify]— in the PR/MR title to skip the Deploy Preview; anywhere in the commit message to skip a branch/production deploy. Next unmarked commit deploys all skipped changes.
Locking, skipping, and manual production deploys
- Lock (disable auto publishing): Deploys list > Lock to stop auto publishing. New deploys still build but are not published. Unlock to resume.
- ⚠ Manual
netlify deploy --prodon a Git-CD site: the next push to the production branch silently replaces your hand-shipped deploy. Warn the user; lock the published deploy if it must stay live.
Managing deploys
- Find: Deploys tab (Developer or Team Owner); search by deploy ID or branch name; filter by time frame, deploy context, and status.
- Cancel: on the in-progress deploy's detail page, Cancel deploy > Yes, cancel deploy.
- Retry: builds from the branch HEAD (optionally clearing cache) — if HEAD moved past the original deploy SHA, it still builds from HEAD.
- Download: on a successful deploy's detail page — a single file via Deploy file browser, or all files as a ZIP via the header Download > Download ready.
- Delete: Developer or Team Owner only. You cannot delete the deploy most recently published to the site's main URL, or one still in progress. Deletion is permanent and does not reduce team costs or preserve build minutes.
Deploy to Netlify button
Template code must be in a public repo on GitHub.com or GitLab.com.
Markdown:
[](https://app.netlify.com/start/deploy?repository=https://github.com/netlify/netlify-statuskit)
URL variants (base link https://app.netlify.com/start/deploy):
# require/pre-fill env vars (hash, client-side only; values may be null)
...?repository=<repo>#SECRET_TOKEN=specialuniquevalue&CUSTOM_LOGO=
# monorepo base dir (whole repo cloned, builds from blog/)
...?repository=<repo>&base=blog
# clone only a subdirectory
...?repository=<repo>&create_from_path=examples/hello
# deploy a specific branch (sets it as production branch)
...?repository=<repo>&branch=beta-feature
# install required SDK extensions before first deploy
...?repository=<repo>&fullConfiguration=true
File-based template config, [template] in the repo root netlify.toml:
[template]
incoming-hooks = ["Contentful"]
required-extensions = ["supabase"]
[template.environment]
SECRET_TOKEN = "change me for your secret token"
CUSTOM_LOGO = "set the url to your custom logo here"
You cannot set env var values or a base directory in [template] — use URL params. [template.environment] placeholder strings are only UI labels.
⚠ Template configuration (incoming hooks, template env vars) is read ONLY from the repository ROOT. When the button targets a subdirectory via base, the base-directory netlify.toml takes precedence for builds, but template config there is ignored. State this limitation explicitly rather than leaving it implied.
Secrets scanning failures
⚠ A secrets-scanning deploy failure means a value that looks like a secret reached your build output. If it's a real secret, that's a leak — stop shipping it in client/published output and rotate it. Never set SECRETS_SCAN_ENABLED=false to silence the scanner over a real leak. For genuinely non-secret values, scope narrowly with SECRETS_SCAN_OMIT_KEYS / SECRETS_SCAN_OMIT_PATHS.
Fixing a failed deploy — no rollbacks
A failed deploy never publishes — the previous deploy is still live, so there is nothing to restore. If someone asks to roll back or restore a previous deploy, correct the premise: after a failed deploy nothing changed, and for a bad published deploy, fix forward — revert the commit and let CI redeploy it. Do not call restoreSiteDeploy or publishDeploy, and do not hand over a dashboard rollback as the answer.
Netlify surfaces a Why did it fail? AI diagnosis above the deploy log — this diagnosis and its suggested solution do NOT consume credits. Selecting Fix with agent starts an agent run, which DOES consume credits from your team's balance. See https://docs.netlify.com/resources/troubleshooting/fix-a-failed-deploy/.
Deploy permissions (private repos)
Netlify only builds changes pushed to private repos from recognized authors (Owners, Developers, Git Contributors; Marketplace bots count). An unrecognized author's merge shows Pending approval; a Team Owner must associate them with a team account before the build starts. Build-hook deploys are exempt.
Constraints & gotchas
- Files per directory: 54,000. Any directory over this in the publish dir fails the deploy. No limit on total files per deploy.
- Skew protection: all plans; production context only — branch deploys, Deploy Previews, and permalinks bypass it and serve the latest deploy. Needs Netlify CLI 23.11.0+. Astro 5.15.0+ enables it by default via the Netlify Adapter; Next.js is opt-in. Password protection on production deploys (or on all deploys) turns skew protection off — it only works when you protect non-production deploys only. Netlify discards skew protection signals on hard navigation (
Sec-Fetch-Mode: navigate, orSec-Fetch-Sitepresent and notsame-origin). Framework maintainers add support vianetlify/v1/skew-protection.json. - ⚠ Search indexing — the latest branch deploy IS indexable: Netlify adds
X-Robots-Tag: noindexto Deploy Previews and older branch deploys, but not to the most recent branch deploy of each branch, sostaging--<site>.netlify.appcan be crawled. The header is no guarantee anyway. To keep previews/branch deploys out of search, set the project to private via project visibility (Credit-based plans only) or turn on Password Protection for non-production deploys (this scope also keeps skew protection working). - Preview URL visibility: Deploy Preview / branch deploy URLs are shareable with anyone holding the link unless you add password or team-login protection.
- New-project visibility: on Credit-based plans with "private by default", new projects start private regardless of how they're created.
- Automatic deletion: deploys are deleted after 30 days (90 days on paid plans); Enterprise can raise this up to 365 days. Never deleted: the published deploy, the most recent successful production deploy, and the most recent successful branch deploy per branch. Configure at Project configuration > Developer settings > Automatic Deletion.
See references/cli-commands.md for the full CLI surface and flags.
Netlify house rules (deploy)
These are org conventions, not docs facts — merged into the rendered skill by ctx-gen and never generated. Owned by the skills maintainer.
- Agents do not roll back deploys: never call
restoreSiteDeployorpublishDeployto restore an older deploy. Fix forward — revert the commit and let CI deploy it. - A failed deploy never publishes; on failure there is nothing to roll back.
- Deep guides live in this skill:
references/netlify-toml.md,references/cli-commands.md,references/deployment-patterns.md. - The frontmatter description must never advertise rollback or restore as a capability — no "roll back", "restore a deploy", or equivalent.
- When the user asks to roll back or restore a previous deploy, correct the
premise rather than complying: after a failed deploy the previous deploy
is still live and there is nothing to restore; for a bad published deploy,
fix forward per rule 1. Do not hand over
restoreSiteDeploy/publishDeployor a dashboard rollback as the answer. - Always add
.netlifyto.gitignorewhen linking or creating a site — every linking path writes.netlify/state.json, which must not be committed. Mention it whenever you link. - Secrets-scanning deploy failures: if the flagged value is a real secret,
that is a leak — stop shipping it in client/published output and rotate
it; never silence the scanner over a real leak. For genuinely non-secret
values, scope narrowly with
SECRETS_SCAN_OMIT_KEYS/SECRETS_SCAN_OMIT_PATHS, neverSECRETS_SCAN_ENABLED=false. - Before running a manual
netlify deploy --prodon a site with Git CD connected, warn the user that the next push to the production branch silently replaces the hand-shipped deploy; suggest locking the published deploy if it must stay live. - Deploy-to-Netlify buttons: template configuration (incoming hooks,
template env vars) is only read from the repository ROOT. When a
button targets a subdirectory via
base, state this limitation explicitly — do not leave it implied.
FAQ
What does the netlify-deploy skill do?
Create, configure, and manage Netlify deploys from code — reach for this when setting up Git continuous deployment, running netlify deploy or netlify deploy --prod from the CLI, writing netlify.toml deploy contexts, adding a Deploy to Netlify button, wiring build hooks, configuring Deploy Previews or branch deploys, locking or skipping deploys, fixing a failed or secrets-scanning deploy, or when someone asks to "deploy my site", "set up preview deploys", "add per-branch build config", "keep staging out of Google", or "add a deploy button to my README".
How do I install netlify-deploy?
Run npx skills add https://github.com/netlify/context-and-tools --skill netlify-deploy in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/netlify-deploy/ (personal) or .claude/skills/netlify-deploy/ (project).
Which AI agents can use netlify-deploy?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is netlify-deploy safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains netlify-deploy?
It is published by netlify in netlify/context-and-tools. It has 3,389 recorded installs.
More from netlify/context-and-tools
netlify-config
netlify/context-and-tools
Configure Netlify builds and routing via netlify.toml, redirects, and headers. Use when setting a build command or publish directory, adding redirects or rewrites or proxies, adding an SPA fallback rewrite, setting custom response headers or basic auth, managing environment variables and secrets, scoping vars per deploy context, marking a var as secret, disabling secret scanning, configuring functions bundling, ignoring builds, or wiring up a monorepo or JavaScript SPA on Netlify.
netlify-functions
netlify/context-and-tools
Write, configure, and deploy Netlify serverless functions in TypeScript, JavaScript, or Go. Use this when adding an API endpoint or backend route, adding a contact form handler, wiring auth or Identity signup/login hooks, identifying which Netlify user is calling a private or team-login-protected app, building streaming or AI-proxy responses, scheduling cron jobs, running long background jobs (batch processing/scraping), reacting to deploy or form events, setting up rate limiting or region/memory config, or reading environment variables and secrets inside a function. Covers file locations, the Request/Context/Response handler shape, path routing, config options, and local testing with netlify dev.
netlify-frameworks
netlify/context-and-tools
Deploy and configure web frameworks on Netlify — build settings and SSR/edge adapters plus local platform emulation and env vars. Use when setting up or fixing a framework deploy (Next.js / Astro / Nuxt / SvelteKit / Remix / React Router / TanStack Start / SolidStart / Gatsby / Angular / Vite / Express / Hydrogen / Hugo / Eleventy / Vue / React), adding SSR or edge functions or middleware wired to Netlify context, fixing SPA redirect and catch-all rules, setting a build command or publish directory, or debugging "why isn't my env var updating" and framework build failures.
netlify-edge-functions
netlify/context-and-tools
Write, route, cache, and debug Netlify Edge Functions, the Deno-based TypeScript or JavaScript handlers in netlify/edge-functions that run at the network edge in front of static files and serverless functions. Activate this skill whenever someone wants to add auth middleware or a login gate, redirect or rewrite visitors by country or cookie, localize or personalize a page with geolocation, run A/B testing, transform or inject HTML into a response, stream server-side rendering at the edge, or cache an edge response. Also use it when an edge function silently does nothing, runs in the wrong order, ignores its Cache-Control headers, or cannot read an environment variable.
netlify-forms
netlify/context-and-tools
Serverless form handling on Netlify-hosted sites — detects HTML forms at deploy time, stores submissions, filters spam, and sends notifications. Use when adding a contact form, lead-capture form, file-upload form, or newsletter signup to a Netlify site; wiring AJAX form submission; setting up a custom thank-you page; adding a honeypot or reCAPTCHA to a form; getting forms working in Next.js, Nuxt, SvelteKit, Astro, or Gatsby; reading form submissions via the Netlify API; setting up submission notifications or ChatGPT automations on form submission events; or debugging missing submissions and forms that silently fail to register.
netlify-caching
netlify/context-and-tools
Cache dynamic and static responses on Netlify's CDN from Functions, Edge Functions, and proxies. Use when you add caching or cache-control headers to a function response, tune cache TTL or stale-while-revalidate, set up the durable cache, vary a cache key by query/header/cookie/country/language, purge or invalidate the cache by site or cache tag, use the programmatic Cache API (caches.open/match/put) or @netlify/cache helpers (fetchWithCache/cacheHeaders/getCacheStatus), speed up an expensive API call, add ISR or on-demand revalidation, or debug why a response is or isn't cached via the Cache-Status header.
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.