diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 778dea70..329ad2d9 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -4,6 +4,11 @@ on: push: branches: - 'main' # 当推送到 main 分支时触发 + paths: + - 'docs/**' + - '.github/workflows/deploy-docs.yml' + - 'package.json' + - 'packages/**' jobs: deploy: diff --git a/.github/workflows/preview-pr-build.yaml b/.github/workflows/preview-pr-build.yaml index e4394964..1862b985 100644 --- a/.github/workflows/preview-pr-build.yaml +++ b/.github/workflows/preview-pr-build.yaml @@ -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 项目