refactor(ci): split surge cleanup into separate job
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 2m50s
/ surge (push) Successful in 3m25s
/ cleanup_surge (push) Successful in 21s
/ playwright (push) Successful in 1m2s
/ lint-build-and-check (push) Successful in 5m20s

This commit is contained in:
严浩
2025-04-27 14:10:56 +08:00
parent 608cd08ca5
commit c6f27856ef

View File

@ -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