fix:修改CI
This commit is contained in:
@@ -12,9 +12,16 @@ jobs:
|
|||||||
image: swr.cn-south-1.myhuaweicloud.com/bws/node:20.19.6-bookworm-slim-ci
|
image: swr.cn-south-1.myhuaweicloud.com/bws/node:20.19.6-bookworm-slim-ci
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# 1. 拉取代码
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# 2. 设置 pnpm(runner 已预装 Node.js,跳过 setup-node)
|
||||||
|
- name: Setup pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 10.23.0
|
||||||
|
|
||||||
- name: Parse tag to env
|
- name: Parse tag to env
|
||||||
run: |
|
run: |
|
||||||
# 获取 tag 名称(Gitea Actions 使用 GITHUB_REF_NAME)
|
# 获取 tag 名称(Gitea Actions 使用 GITHUB_REF_NAME)
|
||||||
@@ -45,25 +52,19 @@ jobs:
|
|||||||
- name: Check toolchain (debug only, 可选)
|
- name: Check toolchain (debug only, 可选)
|
||||||
run: |
|
run: |
|
||||||
node -v || echo "node not found"
|
node -v || echo "node not found"
|
||||||
npm -v || echo "npm not found"
|
pnpm -v || echo "pnpm not found"
|
||||||
curl --version || echo "curl not found"
|
curl --version || echo "curl not found"
|
||||||
|
|
||||||
# 已经在 node:20-bookworm-slim 容器内,无需再 setup-node
|
|
||||||
# - name: Setup Node
|
|
||||||
# uses: actions/setup-node@v4
|
|
||||||
# with:
|
|
||||||
# node-version: '20'
|
|
||||||
|
|
||||||
- name: Use CN npm registry
|
- name: Use CN npm registry
|
||||||
run: |
|
run: |
|
||||||
npm config set registry http://repo.myhuaweicloud.com/repository/npm/
|
npm config set registry http://repo.myhuaweicloud.com/repository/npm/
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
npm ci --no-audit --no-fund
|
pnpm ci --no-audit --no-fund
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: pnpm run build
|
||||||
|
|
||||||
- name: Deploy to Cloudflare Pages
|
- name: Deploy to Cloudflare Pages
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user