From 54da076e6f86d83ebdccb5b1476e5eb0adf63b63 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 24 Feb 2023 03:01:24 +0100 Subject: [PATCH] ci: only publish python package and docker image on release --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e21487c3b..8a2a72ab7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }}