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