Skip to content

Commit

Permalink
添加了draft时不部署和使用path进行选择性部署
Browse files Browse the repository at this point in the history
  • Loading branch information
Leetfs committed Sep 21, 2024
1 parent f785496 commit 0fc6633
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
branches:
- 'main' # 当推送到 main 分支时触发
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yml'
- 'package.json'
- 'packages/**'

jobs:
deploy:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/preview-pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 项目
Expand Down

0 comments on commit 0fc6633

Please sign in to comment.