Skip to content

Commit b96f16a

Browse files
committed
use jobs.<job_id>.steps.if
1 parent b3bbe3b commit b96f16a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/publish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches:
55
- "main"
6-
- "dev"
6+
- "feature-liuzx-ci"
77
tags:
88
- "v*"
99

@@ -23,8 +23,8 @@ on:
2323

2424
# 通过 push 触发的 CI 通过 env 调控。
2525
env:
26-
DEPLOY_DOCKER: false
27-
DEPLOY_DENO: true
26+
DEPLOY_DOCKER_PUSH: false
27+
DEPLOY_DENO_PUSH: true
2828

2929
jobs:
3030
unit-test:
@@ -106,13 +106,14 @@ jobs:
106106

107107
deploy-to-deno:
108108
needs: [upload-art]
109-
if: ${{ inputs.deno || (github.event_name == 'push' && DEPLOY_DENO) }}
110109
runs-on: ubuntu-latest
111110
permissions:
112111
id-token: write
113112
contents: read
114113

115114
steps:
115+
if: ${{ inputs.deno || (github.event_name == 'push' && DEPLOY_DENO_PUSH) }}
116+
116117
- uses: actions/download-artifact@v4
117118
with:
118119
name: deno.js
@@ -124,10 +125,11 @@ jobs:
124125

125126
release-docker:
126127
needs: [test-docker]
127-
if: ${{ inputs.docker || (github.event_name == 'push' && DEPLOY_DOCKER) }}
128128
runs-on: ubuntu-latest
129129

130130
steps:
131+
if: ${{ inputs.docker || (github.event_name == 'push' && DEPLOY_DOCKER_PUSH) }}
132+
131133
- uses: actions/checkout@v3
132134

133135
- name: Login to DockerHub

0 commit comments

Comments
 (0)