From c6f27856ef90cca4e1a43da9fbac5ebeba7e2a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Sun, 27 Apr 2025 14:10:56 +0800 Subject: [PATCH] refactor(ci): split surge cleanup into separate job --- .github/workflows/playwright.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright.yaml index 45855bb..5b5eb00 100644 --- a/.github/workflows/playwright.yaml +++ b/.github/workflows/playwright.yaml @@ -7,6 +7,13 @@ env: on: push: + workflow_dispatch: + inputs: + run_cleanup: + description: '是否运行 Surge 清理 Job' + required: false + type: boolean + default: true jobs: surge: @@ -38,7 +45,13 @@ jobs: run: npx playwright test env: BASE_URL: ${{ needs.surge.outputs.url }} + + cleanup_surge: + runs-on: ubuntu-latest + needs: [surge, playwright] + if: github.event_name == 'push' || github.event.inputs.run_cleanup == true + steps: - name: 🧹 清理 Surge 部署 - run: npx surge teardown ${{ needs.surge.outputs.url }} --token ${{ env.SURGE_TOKEN}} + run: npx surge teardown ${{ needs.surge.outputs.url }} --token ${{ env.SURGE_TOKEN }} env: SURGE_TOKEN: d843de16b331c626f10771245c56ed93