Skip to content

Commit 54da076

Browse files
committed
ci: only publish python package and docker image on release
1 parent f5c6191 commit 54da076

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ jobs:
8686
run: python -m build
8787

8888
- name: Publish Python package
89+
if: github.event_name == 'release'
8990
env:
9091
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
9192
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
@@ -102,12 +103,14 @@ jobs:
102103
uses: docker/setup-buildx-action@v2
103104

104105
- name: Login to DockerHub
106+
if: github.event_name == 'release'
105107
uses: docker/login-action@v2
106108
with:
107109
username: ${{ secrets.DOCKER_USERNAME }}
108110
password: ${{ secrets.DOCKER_PASSWORD }}
109111

110112
- name: Login to GitHub Container Registry
113+
if: github.event_name == 'release'
111114
uses: docker/login-action@v2
112115
with:
113116
registry: ghcr.io
@@ -146,6 +149,6 @@ jobs:
146149
uses: docker/build-push-action@v3
147150
with:
148151
context: .
149-
push: true
152+
push: ${{ github.event_name == 'release' }}
150153
tags: ${{ steps.meta.outputs.tags }}
151154
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)