Skip to content

Commit 40f86af

Browse files
committed
feat: 指定 self-hosted 即可
1 parent 4570086 commit 40f86af

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/pages.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
build:
3535
# push 触发:默认走 self-hosted runner(LDD43LM69N)。
3636
# 手动 workflow_dispatch 时可在 inputs.runner 选择 ubuntu-latest 作为兜底。
37-
runs-on: ${{ inputs.runner == 'ubuntu-latest' && fromJSON('["ubuntu-latest"]') || fromJSON('["self-hosted","LDD43LM69N"]') }}
37+
# 注意:runs-on 匹配的是 runner 的 label 而非 name;这里只用 "self-hosted"
38+
# 通用 label 命中我们挂载到本仓库的 self-hosted runner。
39+
runs-on: ${{ inputs.runner == 'ubuntu-latest' && 'ubuntu-latest' || 'self-hosted' }}
3840
steps:
3941
- name: Checkout
4042
uses: actions/checkout@v4
@@ -72,7 +74,7 @@ jobs:
7274

7375
deploy:
7476
needs: build
75-
runs-on: ${{ inputs.runner == 'ubuntu-latest' && fromJSON('["ubuntu-latest"]') || fromJSON('["self-hosted","LDD43LM69N"]') }}
77+
runs-on: ${{ inputs.runner == 'ubuntu-latest' && 'ubuntu-latest' || 'self-hosted' }}
7678
environment:
7779
name: github-pages
7880
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)