name: github-actions-web description: GitHub Actions 用于 Web 应用的 CI/CD、测试和部署。 allowed-tools: Read, Write, Edit, Bash, Glob, Grep
GitHub Actions Web 技能
为 GitHub Actions 的 CI/CD 提供专家级协助。
能力
- 创建 CI/CD 工作流
- 配置测试自动化
- 设置部署流水线
- 处理密钥
- 优化工作流性能
工作流示例
name: CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run test
- run: npm run build
deploy:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
目标流程
- ci-cd-setup
- automated-testing
- deployment-automation