ci: only publish python package and docker image on release

This commit is contained in:
CrazyMax 2023-02-24 03:01:24 +01:00
parent f5c6191e29
commit 54da076e6f
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

View File

@ -86,6 +86,7 @@ jobs:
run: python -m build
- name: Publish Python package
if: github.event_name == 'release'
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
@ -102,12 +103,14 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: github.event_name == 'release'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
if: github.event_name == 'release'
uses: docker/login-action@v2
with:
registry: ghcr.io
@ -146,6 +149,6 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
push: true
push: ${{ github.event_name == 'release' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}