From 370da4bc4fbf8d7ba9b794ca50f6279e6006b6cb Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Wed, 16 Oct 2024 14:55:07 -0600 Subject: [PATCH] fix CD action to publish to pypi once per release (#356) --- .github/workflows/cd.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3bc6c9d29..5488f64de 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,20 +1,19 @@ name: continuous deployment on: - pull_request: - branches: - - develop - - main push: branches: - develop - main release: + types: + - published jobs: - # deploy docs for develop and main branches + # deploy docs if not release deploy-docs: + if: github.event_name != 'release' runs-on: ubuntu-latest steps: # setup, checkout pull_request.head.ref for repo-vis @@ -56,10 +55,10 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs/_build/html - # deploy distribution if a new release and tag are created + # deploy distribution if release deploy-dist: needs: deploy-docs - if: startsWith(github.ref, 'refs/tags') + if: github.event_name == 'release' runs-on: ubuntu-latest steps: # setup