refactor(ci): split surge cleanup into separate job
This commit is contained in:
13
.github/workflows/playwright.yaml
vendored
13
.github/workflows/playwright.yaml
vendored
@ -7,6 +7,13 @@ env:
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
run_cleanup:
|
||||||
|
description: '是否运行 Surge 清理 Job'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
surge:
|
surge:
|
||||||
@ -38,6 +45,12 @@ jobs:
|
|||||||
run: npx playwright test
|
run: npx playwright test
|
||||||
env:
|
env:
|
||||||
BASE_URL: ${{ needs.surge.outputs.url }}
|
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 部署
|
- 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:
|
env:
|
||||||
|
Reference in New Issue
Block a user