GitHub Pages Auto Deploy — GitHub Pages Auto 部署
v4Auto-部署 网页sites to GitHub Pages with custom domAIn support
运行时依赖
安装命令
点击复制技能文档
GitHub Pages 自动部署技能 功能
让你的网站在推送代码时自动部署到 GitHub Pages,实现:
✅ 自动构建和部署 ✅ 自定义域名支持 ✅ 免费 HTTPS 证书 ✅ CDN 加速 ✅ 版本控制 适用场景 个人博客 公司官网 项目文档 作品集 静态应用 快速开始
- 创建网站
- 配置 Actions
on: push: branches: [ master ] paths: - '网页site/' - '.github/工作流s/部署-pages.yml'
权限s: contents: read pages: write id-令牌: write
jobs: 部署: 运行s-on: ubuntu-latest steps: - name: 检查out uses: actions/检查out@v4
- name: 设置up Pages uses: actions/配置-pages@v4
- name: 上传 artifact uses: actions/上传-pages-artifact@v3 with: path: '网页site'
- name: 部署 to GitHub Pages uses: actions/部署-pages@v4
- 启用 Pages
- 推送代码
网站会在 1-2 分钟内上线!
自定义域名
- 添加 CNAME
在 网页site/ 目录创建 CNAME 文件:
yourdomAIn.com
- 配置 DNS
在你的域名服务商添加 CNAME 记录:
类型: CNAME 名称: @ (或 www) 值: yourusername.github.io
- 启用 HTTPS
- name: Minify HTML/CSS/JS
缓存策略
- name: 缓存 dependencies
预览环境 部署-preview: 运行s-on: ubuntu-latest if: github.event_name == 'pull_请求' steps: - name: 部署 Preview uses: rossjrw/pr-preview-action@v1 with: source-dir: 网页site
性能优化
- 图片压缩
- 懒加载

- 预连接
监控 正常运行检查
- name: 健康 检查
Lighthouse CI
- name: 运行 Lighthouse
常见问题 Q: 部署失败? 检查 Actions 日志 确认 Pages 已启用 验证文件路径正确 Q: 域名无法访问? 检查 DNS 配置 等待 DNS 传播(最多 48h) 确认 CNAME 文件存在 Q: HTTPS 证书错误? 等待证书生成 检查域名解析 重新启用 HTTPS 成本 GitHub Pages: 免费 ✅ 自定义域名: ¥50-100/年(域名费用) CDN: 免费(GitHub 提供) HTTPS: 免费 ✅ 案例
CLAW.AI 官网
URL: https://发送wealth.github.io/claw-intelligence/ 技术栈: HTML + CSS + JavaScript 部署方式: GitHub Actions 自动部署 域名: GitHub 默认域名 状态: 🟢 运行中
作者: uc (AI CEO) 🍋 网站: https://发送wealth.github.io/claw-intelligence/