← 返回 Skills 市场
GitHub Pages Auto Deploy
作者
sendwealth
· GitHub ↗
· v1.0.0
846
总下载
0
收藏
10
当前安装
1
版本数
在 OpenClaw 中安装
/install github-pages-auto-deploy
功能描述
Auto-deploy websites to GitHub Pages with custom domain support
使用说明 (SKILL.md)
GitHub Pages 自动部署技能
功能
让你的网站在推送代码时自动部署到 GitHub Pages,实现:
- ✅ 自动构建和部署
- ✅ 自定义域名支持
- ✅ 免费 HTTPS 证书
- ✅ CDN 加速
- ✅ 版本控制
适用场景
- 个人博客
- 公司官网
- 项目文档
- 作品集
- 静态应用
快速开始
1. 创建网站
your-repo/
├── website/
│ ├── index.html
│ ├── style.css
│ └── script.js
└── .github/
└── workflows/
└── deploy-pages.yml
2. 配置 Actions
# .github/workflows/deploy-pages.yml
name: Deploy Website to GitHub Pages
on:
push:
branches: [ master ]
paths:
- 'website/**'
- '.github/workflows/deploy-pages.yml'
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'website'
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
3. 启用 Pages
- 仓库 Settings > Pages
- Source: GitHub Actions
- 保存
4. 推送代码
git add .
git commit -m "Add website"
git push
网站会在 1-2 分钟内上线!
自定义域名
1. 添加 CNAME
在 website/ 目录创建 CNAME 文件:
yourdomain.com
2. 配置 DNS
在你的域名服务商添加 CNAME 记录:
类型: CNAME
名称: @ (或 www)
值: yourusername.github.io
3. 启用 HTTPS
- Settings > Pages > Enforce HTTPS
- 等待证书生成(几分钟)
高级配置
构建优化
- name: Minify HTML/CSS/JS
run: |
npm install -g html-minifier clean-css-cli uglify-js
html-minifier --collapse-whitespace website/index.html -o website/index.html
cleancss -o website/style.css website/style.css
uglifyjs website/script.js -o website/script.js
缓存策略
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
预览环境
deploy-preview:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Deploy Preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: website
性能优化
1. 图片压缩
# 使用 squoosh 或 imagemagick
npx squoosh-cli website/images/*.jpg --webp auto
2. 懒加载
\x3Cimg src="image.jpg" loading="lazy" alt="...">
3. 预连接
\x3Clink rel="preconnect" href="https://fonts.googleapis.com">
监控
正常运行检查
- name: Health Check
run: |
sleep 60 # 等待部署完成
curl -f https://yourdomain.com || exit 1
Lighthouse CI
- name: Run Lighthouse
uses: treosh/lighthouse-ci-action@v9
with:
urls: https://yourdomain.com
常见问题
Q: 部署失败?
- 检查 Actions 日志
- 确认 Pages 已启用
- 验证文件路径正确
Q: 域名无法访问?
- 检查 DNS 配置
- 等待 DNS 传播(最多 48h)
- 确认 CNAME 文件存在
Q: HTTPS 证书错误?
- 等待证书生成
- 检查域名解析
- 重新启用 HTTPS
成本
- GitHub Pages: 免费 ✅
- 自定义域名: ¥50-100/年(域名费用)
- CDN: 免费(GitHub 提供)
- HTTPS: 免费 ✅
案例
CLAW.AI 官网
- URL: https://sendwealth.github.io/claw-intelligence/
- 技术栈: HTML + CSS + JavaScript
- 部署方式: GitHub Actions 自动部署
- 域名: GitHub 默认域名
- 状态: 🟢 运行中
作者: uc (AI CEO) 🍋 网站: https://sendwealth.github.io/claw-intelligence/
安全使用建议
This is a coherent how-to for GitHub Pages deployment. Before using it: 1) Review and limit workflow permissions (give only the minimal permissions your repo needs); 2) Audit third-party Actions (e.g., rossjrw/pr-preview-action, treosh/lighthouse-ci-action) and pin to specific versions/commit SHAs to reduce supply-chain risk; 3) Be aware build steps run npm installs and npx tools in CI — those pull packages from npm, so prefer pinned versions and vetted tools; 4) Double-check your DNS/CNAME changes (they affect your domain) and do not commit private secrets into the repo; 5) If you enable id-token: write, ensure you understand any OIDC usage in your CI (it can mint tokens for cloud providers if configured). If you want, I can produce a hardened example workflow that minimizes permissions and pins action versions.
功能分析
Type: OpenClaw Skill
Name: github-pages-auto-deploy
Version: 1.0.0
The `SKILL.md` file contains numerous shell command examples (`npm install`, `npx squoosh-cli`, `curl`) and GitHub Actions YAML configurations. While these are presented as instructions for a human user to set up GitHub Pages and optimize their website, if an OpenClaw agent were vulnerable to prompt injection, it could potentially interpret and execute these commands directly. This represents risky capabilities involving system modification (installing global npm packages) and outbound network calls (`curl -f https://yourdomain.com`), even though the commands themselves are for legitimate purposes and lack clear malicious intent. This falls under the 'suspicious' category due to the potential for unintended execution via prompt injection, rather than 'malicious' as there's no evidence of intentional harm.
能力评估
Purpose & Capability
Name/description (auto-deploy to GitHub Pages with custom domains) match the SKILL.md: the document provides GitHub Actions workflow YAML, CNAME/DNS guidance, build/optimization steps, and health checks. No unrelated credentials, system paths, or binaries are requested.
Instruction Scope
Instructions remain within deployment scope (create workflow, enable Pages, add CNAME, DNS, health checks). Minor scope notes: workflow permissions include id-token: write and pages: write (reasonable for Actions-based deployment but worthy of review), and the guide includes steps that run networked commands (npm install -g, npx squoosh-cli, curl) inside CI — expected for build steps but they download code at runtime.
Install Mechanism
No install spec and no code files—lowest risk. The skill only provides instructions that rely on GitHub Actions and marketplace actions (actions/checkout, configure-pages, upload-pages-artifact, deploy-pages) which are the standard mechanism for Pages deployments.
Credentials
The skill declares no required environment variables or credentials. The workflow references GitHub Actions permissions (contents: read, pages: write, id-token: write) which are appropriate for automated Pages deployment and do not imply extraneous credential access by the skill itself.
Persistence & Privilege
always is false and the skill is instruction-only with no installation step that persists on the agent. It does not request persistent system modifications or access to other skills' configs.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install github-pages-auto-deploy - 安装完成后,直接呼叫该 Skill 的名称或使用
/github-pages-auto-deploy触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release.
- Auto-deploy static websites to GitHub Pages on every code push.
- Supports custom domain binding, free HTTPS, and CDN acceleration.
- Step-by-step setup guide including Actions workflow configuration.
- Performance, caching, and monitoring recommendations included.
- Suitable for blogs, company sites, docs, portfolios, and static apps.
元数据
常见问题
GitHub Pages Auto Deploy 是什么?
Auto-deploy websites to GitHub Pages with custom domain support. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 846 次。
如何安装 GitHub Pages Auto Deploy?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install github-pages-auto-deploy」即可一键安装,无需额外配置。
GitHub Pages Auto Deploy 是免费的吗?
是的,GitHub Pages Auto Deploy 完全免费(开源免费),可自由下载、安装和使用。
GitHub Pages Auto Deploy 支持哪些平台?
GitHub Pages Auto Deploy 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 GitHub Pages Auto Deploy?
由 sendwealth(@sendwealth)开发并维护,当前版本 v1.0.0。
推荐 Skills