name: deploy-docs description: 验证并准备文档以进行GitHub Pages部署
部署文档命令
验证文档站点并准备它进行GitHub Pages部署。
步骤1:验证文档
运行以下检查:
# Count components
echo "Agents: $(ls plugins/compound-engineering/agents/*.md | wc -l)"
echo "Commands: $(ls plugins/compound-engineering/commands/*.md | wc -l)"
echo "Skills: $(ls -d plugins/compound-engineering/skills/*/ 2>/dev/null | wc -l)"
# Validate JSON
cat .claude-plugin/marketplace.json | jq . > /dev/null && echo "✓ marketplace.json valid"
cat plugins/compound-engineering/.claude-plugin/plugin.json | jq . > /dev/null && echo "✓ plugin.json valid"
# Check all HTML files exist
for page in index agents commands skills mcp-servers changelog getting-started; do
if [ -f "plugins/compound-engineering/docs/pages/${page}.html" ] || [ -f "plugins/compound-engineering/docs/${page}.html" ]; then
echo "✓ ${page}.html exists"
else
echo "✗ ${page}.html MISSING"
fi
done
步骤2:检查未提交的更改
git status --porcelain plugins/compound-engineering/docs/
如果有未提交的更改,警告用户先提交。
步骤3:部署说明
由于GitHub Pages部署需要一个具有特殊权限的工作流文件,请提供以下说明:
首次设置
- 使用GitHub Pages工作流创建
.github/workflows/deploy-docs.yml - 转到仓库设置 > 页面
- 将源设置为 “GitHub Actions”
部署
合并到 main 后,文档将自动部署。或者:
- 转到操作标签
- 选择 “部署文档到GitHub Pages”
- 点击 “运行工作流”
工作流文件内容
name: Deploy Documentation to GitHub Pages
on:
push:
branches: [main]
paths:
- 'plugins/compound-engineering/docs/**'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: 'plugins/compound-engineering/docs'
- uses: actions/deploy-pages@v4
步骤4:报告状态
提供一个摘要:
## 部署准备就绪
✓ 所有HTML页面存在
✓ JSON文件有效
✓ 组件计数匹配
### 下一步
- [ ] 提交任何待处理的更改
- [ ] 推送到主分支
- [ ] 验证GitHub Pages工作流是否存在
- [ ] 在 https://everyinc.github.io/every-marketplace/ 检查部署