Skip to content

Commit

Permalink
fix CD action to publish to pypi once per release (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewSteen authored Oct 16, 2024
1 parent 947483c commit 370da4b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 370da4b

Please sign in to comment.