Skip to content

Commit

Permalink
TEST: Release action
Browse files Browse the repository at this point in the history
  • Loading branch information
melissawm committed Sep 25, 2024
1 parent 4d37d47 commit 0964304
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,45 @@ jobs:
# Downloads to '/home/runner/work/docs/docs/html'
path: html

- name: Deploy Docs
- name: Deploy Dev Docs
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/main'))
uses: peaceiris/actions-gh-pages@v3
with:
# Note that GITHUB_TOKEN has no permission to access to external repositories.
# When you use deploy_key, set your private key to the repository which
# includes this action as a secret, and set your public key to your external repository.
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: napari/napari.github.io
external_repository: melissawm/napari.github.io
publish_dir: ./html
publish_branch: gh-pages
destination_dir: ${{ github.event.inputs.target_directory || 'dev' }}
cname: napari.org

- name: Deploy Release Docs
if: (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev'))
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: melissawm/napari.github.io
publish_dir: ./html
publish_branch: gh-pages
destination_dir: ${{ github.event.inputs.target_directory || github.event.release.tag_name }}
cname: napari.org

# Because we are using two deploy actions, we need to reset the ssh-agent
# to avoid the following error:
# unix_listener: cannot bind to path /tmp/ssh-auth.sock: Address already in use
- name: Reset ssh agent
run: killall ssh-agent

- name: Set up stable symlink
if: (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev'))
uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
owner: melissawm
repo: napari.github.io
github_token: ${{ secrets.ACTIONS_DEPLOY_KEY }}
workflow_file_name: 'symlink-stable.yml'
client_payload: '{
"target_directory": "${{ github.event.inputs.target_directory || github.event.release.tag_name }}"
}'

0 comments on commit 0964304

Please sign in to comment.