Skip to content

Commit a3d352c

Browse files
committed
fix: improving stage skipping for releasing
1 parent bc93040 commit a3d352c

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

‎.github/workflows/build_and_package.yml‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,12 @@ jobs:
223223

224224
release:
225225
name: Release project
226-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
227226
needs: [build]
227+
if: >
228+
always() &&
229+
needs.build.result == 'success' &&
230+
github.event_name == 'push' &&
231+
startsWith(github.ref, 'refs/tags/v')
228232
runs-on: ubuntu-latest
229233
environment: release
230234
permissions:
@@ -254,13 +258,23 @@ jobs:
254258

255259

256260
docker:
261+
name: Build and push Docker image
257262
needs: [build, release]
258263
if: |
259264
always() &&
260265
needs.build.result == 'success' &&
261-
((github.event_name == 'schedule' && github.ref == 'refs/heads/main') ||
262-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')))
266+
(
267+
(github.event_name == 'schedule' && github.ref == 'refs/heads/main') ||
268+
(
269+
github.event_name == 'push' &&
270+
startsWith(github.ref, 'refs/tags/v') &&
271+
needs.release.result == 'success'
272+
)
273+
)
263274
runs-on: ubuntu-latest
275+
permissions:
276+
contents: read
277+
packages: write
264278
steps:
265279
- name: Checkout repository
266280
uses: actions/checkout@v4

0 commit comments

Comments
 (0)