mirror of
https://github.com/riba2534/TCP-IP-NetworkNote.git
synced 2026-07-01 02:16:05 +08:00
- npm ci 在 GitHub runner 上偶发 'Exit handler never called' 错误, 改用 npm install 更稳健,去掉可能干扰的 npm cache 配置 - Node 20 已 deprecated,升级到 22 LTS - 同时优化根 README:增加网站链接、徽章、目录、本地运行说明, 按标准开源项目结构组织
36 lines
813 B
YAML
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
|