← 返回
开发者工具 Key

Netlify

Use the Netlify CLI (netlify) to create/link Netlify sites and set up CI/CD (continuous deployment) from GitHub, especially for monorepos (multiple sites in one repo like Hugo sites under sites/<domain>). Use when Avery asks to deploy a new site, connect a repo to Netlify, configure build/publish settings, set environment variables, enable deploy previews, or automate Netlify site creation.
使用 Netlify CLI 创建或链接站点,并从 GitHub 设置 CI/CD(尤其适用于单仓库多站点场景)。当 Avery 请求部署新站点、连接仓库、配置构建设置、设置环境变量、启用部署预览或自动化站点创建时使用。
ajmwagar
开发者工具 clawhub v1.0.0 1 版本 98490.5 Key: 需要
★ 2
Stars
📥 4,723
下载
💾 133
安装
1
版本
#cicd#deployment#hosting#latest#monorepo#netlify

概述

netlify

Use the netlify CLI to create projects (“sites”), link local folders, and configure CI/CD from GitHub.

Pre-reqs

  • netlify --version
  • Logged in (netlify login) or provide --auth $NETLIFY_AUTH_TOKEN.
  • Know the Netlify team/account slug you want to create sites under (optional but recommended).

Helpful checks:

netlify status
netlify sites:list

Monorepo pattern (recommended)

For one repo with multiple sites (e.g. sites/seattlecustomboatparts.com, sites/floridacustomerboatparts.com):

  • Create one Netlify site per domain.
  • Set the site’s Base directory to that subfolder.
  • Put a netlify.toml inside that subfolder.

This keeps each domain’s build config self-contained.

Hugo subfolder netlify.toml

Create sites//netlify.toml:

[build]
  command = "hugo --minify"
  publish = "public"

[build.environment]
  HUGO_VERSION = "0.155.1"

(Adjust HUGO_VERSION as needed.)

Fast workflow: create + link + init CI/CD

1) Create a Netlify site (project)

Run inside the site folder you want to deploy (base dir):

cd sites/<domain>
netlify sites:create --name <netlify-site-name> --account-slug <team> --with-ci

Notes:

  • --with-ci starts CI hooks setup.
  • If you need manual control, add --manual.

2) Link local folder to the created site

If not linked already:

netlify link

3) Connect to GitHub for continuous deployment

netlify init

This is usually interactive (select Git remote/repo + build settings). For automation we can pre-create netlify.toml and then accept defaults.

Environment variables

Set per-site vars:

netlify env:set VAR_NAME value
netlify env:list

Useful for monorepos:

  • CONTACT_EMAIL (or other shared config)

Deploy

Manual deploys (handy for quick preview):

netlify deploy            # draft deploy
netlify deploy --prod     # production deploy

Included scripts

  • scripts/hugo_netlify_toml.sh: create a netlify.toml in a Hugo subfolder
  • scripts/netlify_monorepo_site.sh: helper to create/link/init a site for a subfolder

When using scripts, prefer passing NETLIFY_AUTH_TOKEN via env for non-interactive runs.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 12:50 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,726
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,786
content-creation

Create Dxf

ajmwagar
根据源自自然语言设计提示的严格验证JSON规范,生成适用于询价(RFQ)的2D DXF文件(可选SVG预览)。专用于水刀、激光或数控加工的板材零件(如安装板、角撑、支架、孔阵及槽口)。
★ 1 📥 3,060