From 9a4a3ec36c485ac8f223d117d9d5895c0a72b1dd Mon Sep 17 00:00:00 2001 From: YuYang Shen Date: Mon, 25 Aug 2025 12:03:16 +0800 Subject: [PATCH] Change Action --- .gitea/workflows/sphinx.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/sphinx.yml b/.gitea/workflows/sphinx.yml index 171747d..a8851e4 100644 --- a/.gitea/workflows/sphinx.yml +++ b/.gitea/workflows/sphinx.yml @@ -2,7 +2,7 @@ name: Build and Deploy Sphinx Docs on: pull_request: - types: [closed] + types: [opened, synchronize, reopened] branches: [master] jobs: @@ -81,7 +81,20 @@ jobs: echo "Build output contents:" ls -la /home/ly0kos/work/test_env/build/ - # 第四步:部署到Web服务器 +name: Deploy on Merge + +on: + pull_request: + types: [closed] + branches: [main] + +jobs: + deploy: + # 关键:只在PR被成功merge时运行 + if: github.event.pull_request.merged == true + runs-on: linux + steps: + # 第一步:部署到Web服务器 - name: Deploy to web server run: | echo "=== Deploying to web server ===" @@ -95,7 +108,7 @@ jobs: echo "Web server contents:" ls -la /var/www/docs_dev/ | head -10 - # 第五步:清理临时工作树 + # 第二步:清理临时工作树 - name: Cleanup temporary worktree run: | echo "=== Cleaning up ==="