chore(ci-cd): 重构工作流,合并构建和部署步骤
All checks were successful
/ playwright (push) Successful in 2m57s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m3s

This commit is contained in:
严浩
2025-09-18 12:57:00 +08:00
parent 077e7b5c90
commit c928aa72bc

View File

@@ -12,7 +12,7 @@ on:
workflow_dispatch:
jobs:
lint-build-and-typecheck:
build-and-deploy:
runs-on: ubuntu-latest
container: gitea/runner-images:ubuntu-latest-slim # https://github.com/cloudflare/wrangler-action/issues/329#issuecomment-3046747722
@@ -44,32 +44,6 @@ jobs:
- name: ✅ 类型检查
run: pnpm run type-check # 要先 build保证 components.d.ts 存在
deploy:
runs-on: ubuntu-latest
needs: lint-build-and-typecheck
if: github.ref == 'refs/heads/main'
# https://github.com/cloudflare/wrangler-action/issues/329#issuecomment-3046747722
container:
image: gitea/runner-images:ubuntu-latest-slim
steps:
- name: 🛠️ 设置Node环境
uses: yanhao98/composite-actions/setup-node-environment@25eb4dc0c134cc9df2b7c569aa54140a366b45a8
- name: 📦 构建项目
run: pnpm run build-only
env:
VITE_BUILD_COMMIT: ${{ github.sha }}
# - name: 🚀 上传版本到 Cloudflare
# uses: cloudflare/wrangler-action@v3
# id: upload
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# command: versions upload --tag "${{ github.sha }}" --message "Deploy commit ${{ github.sha }} from ${{ github.ref_name }}"
- name: 🚀 部署到 Cloudflare
uses: cloudflare/wrangler-action@v3
with: