From e103b7dff801167fe9d1786422e389cffb8162d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Thu, 19 Sep 2024 13:09:56 -0300 Subject: [PATCH] TEST: Release action --- .github/workflows/build_and_deploy.yml | 35 ++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index e02aad73..a6a7e0c8 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -111,13 +111,44 @@ 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 + + # 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 + # See https://github.com/peaceiris/actions-gh-pages/issues/909 + - name: Reset ssh agent + run: killall ssh-agent + + - 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 + + - 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 }}"}'