Skip to content

Commit

Permalink
Add condition to filter out release candidates from release action
Browse files Browse the repository at this point in the history
  • Loading branch information
melissawm committed Oct 22, 2024
1 parent 369746c commit 7816720
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ jobs:
# unix_listener: cannot bind to path /tmp/ssh-auth.sock: Address already in use
# See https://github.com/peaceiris/actions-gh-pages/issues/909
- name: Reset ssh agent
if: (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev'))
if: ((github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev'))
run: killall ssh-agent

# Because the actions-gh-pages triggers a pages deployment, it can be some
# time before the repo is updated. We need to wait for the deployment to
# complete before we can create a second deployment, or we will have a git
# conflict. The 5m sleep is completely arbitrary.
- name: Wait for first deployment
if: (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev'))
if: ((github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev'))
run: sleep 5m

- name: Deploy Release Docs
if: (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev'))
if: ((github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev'))
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
Expand All @@ -155,7 +155,7 @@ jobs:
keep_files: true

- name: Set up stable symlink
if: (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev'))
if: ((github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev'))
uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
owner: napari
Expand Down

0 comments on commit 7816720

Please sign in to comment.