refactor(ci): split surge cleanup into separate job
This commit is contained in:
15
.github/workflows/playwright.yaml
vendored
15
.github/workflows/playwright.yaml
vendored
@ -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
|
||||
|
Reference in New Issue
Block a user