添加了 draft 时不部署和使用 path 进行选择性部署 (#433)
部署到 Cloudflare Pages / deploy (push) Has been cancelled Details

pull/430/head
Lee 2024-09-21 20:03:32 +08:00 committed by GitHub
parent f78549639a
commit 1c81a9887e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -4,6 +4,11 @@ on:
push:
branches:
- 'main' # 当推送到 main 分支时触发
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yml'
- 'package.json'
- 'packages/**'
jobs:
deploy:

View File

@ -2,10 +2,16 @@ name: 部署 PR 到 Cloudflare Pages
on:
pull_request_target:
types: [opened, synchronize, reopened] # 当 PR 被创建、更新或重新打开时触发
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'docs/**'
- '.github/workflows/preview-pr-build.yaml'
- 'package.json'
- 'packages/**'
jobs:
deploy:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
@ -32,6 +38,9 @@ jobs:
- name: 安装依赖
run: pnpm install
# - name: 更新主题包
# run: pnpm update @project-trans/vitepress-theme-project-trans@prerelease
# 第五步:构建项目
- name: 构建项目
run: pnpm build # 构建 VitePress 项目