chore(ci-cd): 重构工作流,合并构建和部署步骤
This commit is contained in:
28
.github/workflows/ci-cd.yaml
vendored
28
.github/workflows/ci-cd.yaml
vendored
@@ -12,7 +12,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-build-and-typecheck:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: gitea/runner-images:ubuntu-latest-slim # https://github.com/cloudflare/wrangler-action/issues/329#issuecomment-3046747722
|
container: gitea/runner-images:ubuntu-latest-slim # https://github.com/cloudflare/wrangler-action/issues/329#issuecomment-3046747722
|
||||||
|
|
||||||
@@ -44,32 +44,6 @@ jobs:
|
|||||||
- name: ✅ 类型检查
|
- name: ✅ 类型检查
|
||||||
run: pnpm run type-check # 要先 build,保证 components.d.ts 存在
|
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
|
- name: 🚀 部署到 Cloudflare
|
||||||
uses: cloudflare/wrangler-action@v3
|
uses: cloudflare/wrangler-action@v3
|
||||||
with:
|
with:
|
||||||
|
Reference in New Issue
Block a user