Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CD action to publish to pypi once per release #356

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines -4 to -7
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this because:

  1. It doesn't look like this action is running on PRs
  2. I think we should do tests for building docs and Test PyPI in the CI action on PRs (approved?). So, when we finally push to develop and main we should know that those tests pass and we don't have to do it here.

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
Loading