Files
TCP-IP-NetworkNote/.github/workflows/deploy.yml
riba2534 a86196e2ea fix: 修复 CI npm ci 失败改用 npm install + Node 22
- npm ci 在 GitHub runner 上偶发 'Exit handler never called' 错误,
  改用 npm install 更稳健,去掉可能干扰的 npm cache 配置
- Node 20 已 deprecated,升级到 22 LTS
- 同时优化根 README:增加网站链接、徽章、目录、本地运行说明,
  按标准开源项目结构组织
2026-06-28 13:22:57 +08:00

36 lines
813 B
YAML

name: Deploy to Cloudflare Pages
on:
push:
branches: [master]
workflow_dispatch:
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: npm install
working-directory: site
- name: Build site
run: npm run build
working-directory: site
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages deploy .vitepress/dist --project-name=tcp-ip-notes
workingDirectory: site