fix(workflow): 更新部署工作流程以确保在推送和 PR 中正确触发构建
This commit is contained in:
parent
60f97fcd4b
commit
666a1fa28e
13
.github/workflows/deploy.yml
vendored
13
.github/workflows/deploy.yml
vendored
@ -3,10 +3,18 @@
|
|||||||
name: Deploy VitePress site to Pages
|
name: Deploy VitePress site to Pages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# 在针对 `main` 分支的推送上运行。如果你
|
# 在 docs 相关变更推送时运行构建(任意分支)
|
||||||
# 使用 `master` 分支作为默认分支,请将其更改为 `master`
|
|
||||||
push:
|
push:
|
||||||
|
paths:
|
||||||
|
- 'docs/**'
|
||||||
|
- '.github/workflows/deploy.yml'
|
||||||
|
|
||||||
|
# 在面向 main 的 PR 中提前验证 docs 构建
|
||||||
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'docs/**'
|
||||||
|
- '.github/workflows/deploy.yml'
|
||||||
|
|
||||||
# 允许你从 Actions 选项卡手动运行此工作流程
|
# 允许你从 Actions 选项卡手动运行此工作流程
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -51,6 +59,7 @@ jobs:
|
|||||||
|
|
||||||
# 部署工作
|
# 部署工作
|
||||||
deploy:
|
deploy:
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
environment:
|
environment:
|
||||||
name: github-pages
|
name: github-pages
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user