Skip to content

Commit b3bbe3b

Browse files
committed
try use env to trigger CI when push successfully
1 parent 3bcce81 commit b3bbe3b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
tags:
88
- "v*"
99

10+
# workflow_dispatch 是 GitHub 的手动触发 CI 机制,可以与 inputs 预定义的变量一起使用,对 push 触发的 CI 不生效。
1011
workflow_dispatch:
1112
inputs:
1213
docker:
@@ -20,6 +21,11 @@ on:
2021
type: boolean
2122
default: true
2223

24+
# 通过 push 触发的 CI 通过 env 调控。
25+
env:
26+
DEPLOY_DOCKER: false
27+
DEPLOY_DENO: true
28+
2329
jobs:
2430
unit-test:
2531
runs-on: ubuntu-latest
@@ -100,7 +106,7 @@ jobs:
100106

101107
deploy-to-deno:
102108
needs: [upload-art]
103-
if: ${{ inputs.deno || github.event_name == 'push' }}
109+
if: ${{ inputs.deno || (github.event_name == 'push' && DEPLOY_DENO) }}
104110
runs-on: ubuntu-latest
105111
permissions:
106112
id-token: write
@@ -118,7 +124,7 @@ jobs:
118124

119125
release-docker:
120126
needs: [test-docker]
121-
if: ${{ inputs.docker || github.event_name == 'push' }}
127+
if: ${{ inputs.docker || (github.event_name == 'push' && DEPLOY_DOCKER) }}
122128
runs-on: ubuntu-latest
123129

124130
steps:

0 commit comments

Comments
 (0)