Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)260k · #580

publish-site

Skill này làm gì

Skill này giúp AI của bạn xuất bản một website tĩnh hoặc bản build ứng dụng web lên một máy chủ bạn sở hữu, rồi cập nhật hoặc khôi phục sau. Phù hợp với người muốn có một liên kết chia sẻ cho trang họ đã làm.

Khi nào nên dùng

  • ✓Khi bạn muốn AI đưa một website, bảng điều khiển hoặc báo cáo lên mạng và cho bạn một liên kết.
  • ✓Khi bạn muốn cập nhật một website đã được xuất bản với nội dung mới.
  • ✓Khi bạn muốn khôi phục một website về phiên bản trước sau một lần triển khai lỗi.

Liên kết skill

https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/web-development/publish-site/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/web-development/publish-site/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Đưa bảng điều khiển này lên mạng và cho tôi một liên kết để chia sẻ với đội của mình.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill kiểm tra bạn đang đăng nhập vào nhà cung cấp nào, xem trước trang trên máy cục bộ, gắn thẻ phiên bản cho từng lần triển khai, rồi triển khai lên nhà cung cấp đầu tiên có sẵn. Sau đó nó kiểm tra liên kết trực tiếp qua HTTP.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Publish Site

Take a website, dashboard, or web app the user built (or you built for them) and put it online on infrastructure the user owns — GitHub Pages by default, Cloudflare Pages or Netlify when they need more. The discipline: preview locally for sign-off, version every deploy with a git tag, deploy through a provider ladder, verify the live URL with a real HTTP check, and keep rollback one command away.

This skill covers static sites and SPA build output (plain HTML/CSS/JS, or the dist//build/ folder from Vite/Next-export/Astro/etc.). It does not cover server-side runtimes — for throwaway serverless deploys with zero account setup, use the cloudflare-temporary-deploy optional skill instead.

When to Use

Load this skill when the user asks to:

  • Put a site online — "publish this", "host this somewhere", "give me a link I can share"
  • Deploy a dashboard, report, portfolio, docs site, or prototype you just generated
  • Update an already-published site with new content (redeploy = new version)
  • Roll back a bad deploy to the previous version
  • Pick a host — they don't care where, they just want a URL

Prerequisites

At least ONE authenticated provider CLI (check in this order):

  • GitHub Pages (default): gh auth status succeeds. Needs git too.
  • Cloudflare Pages: wrangler whoami succeeds (or CLOUDFLARE_API_TOKEN is set). Install: npm i -g wrangler or use npx wrangler@latest.
  • Netlify (fallback): netlify status succeeds. Install: npm i -g netlify-cli.

Plus:

  • A directory of static output to publish (site root or a dist//build/ folder). If the project needs a build step, run it first and publish the output directory, never the source.
  • For local preview sharing: cloudflared (optional — python3 -m http.server covers local-only preview).

How to Run

All commands below run via the terminal tool from the site's project directory. The pipeline is always the same five moves:

  1. Build → 2. Preview for sign-off → 3. Commit + tag (version-before-deploy) → 4. Deploy via the provider ladder → 5. Verify the live URL with curl and report it.

Quick Reference

Step Command
Local preview python3 -m http.server 8080 --directory dist
Shareable preview cloudflared tunnel --url http://localhost:8080
Version a deploy git add -A && git commit -m "deploy: <what>" && git tag deploy-YYYYMMDD-HHMM
GitHub Pages (branch mode) git subtree push --prefix dist origin gh-pages
Enable Pages on repo gh api repos/{owner}/{repo}/pages -X POST -f 'source[branch]=gh-pages' -f 'source[path]=/'
Cloudflare Pages npx wrangler@latest pages deploy dist --project-name <name>
Netlify netlify deploy --prod --dir dist
Rollback git checkout <previous-tag> -- . && redeploy (or provider dashboard)
Verify live curl -sS -o /dev/null -w '%{http_code}' <url> → expect 200

Procedure

1. Build and preview locally

Build if needed (npm run build, etc.) and identify the output directory. Serve it:

python3 -m http.server 8080 --directory dist

For a shareable preview link (user on another machine, or you want their sign-off before going live), open a quick tunnel in a background terminal session:

cloudflared tunnel --url http://localhost:8080

Give the user the https://*.trycloudflare.com URL and get sign-off before deploying. Kill the tunnel afterwards.

2. Version before deploy — no exceptions

Every deploy must come from a git commit, so every deploy is reproducible and rollback is trivial.

git init 2>/dev/null; git add -A
git commit -m "deploy: <short description>"
git tag "deploy-$(date +%Y%m%d-%H%M)"

If the project already has a repo, just commit + tag. Never deploy uncommitted files.

3. Deploy — provider ladder

Rung 1 — GitHub Pages (default: free, zero extra accounts if gh is authed):

gh repo create <name> --public --source . --push   # skip if repo exists
git subtree push --prefix dist origin gh-pages      # publish build output
gh api "repos/{owner}/<name>/pages" -X POST \
  -f 'source[branch]=gh-pages' -f 'source[path]=/'  # first time only

Site appears at https://<owner>.github.io/<name>/. If the site is the repo root (no build dir), push main and set Pages source to main instead of using subtree. For build-step projects that will redeploy often, prefer the official actions/deploy-pages workflow so p

Câu hỏi thường gặp

Nó hỗ trợ những nhà cung cấp nào?

Skill mặc định hỗ trợ GitHub Pages, và cũng hỗ trợ Cloudflare Pages và Netlify.

Nó có xử lý ứng dụng phía máy chủ không?

Không. Skill bao quát website tĩnh và bản build ứng dụng một trang, không bao quát runtime phía máy chủ.

Tôi có thể hoàn tác một lần triển khai không?

Có. Skill nói mỗi lần triển khai được gắn thẻ để có thể khôi phục bằng một lệnh.

Chi tiết

Mô tả gốc của tác giả

Versioned site deploys to GitHub/Cloudflare/Netlify Pages.

repo: NousResearch/hermes-agent

Độ phổ biến

Sao GitHub
260k
Vị trí xếp hạng
#580
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự