From fc51a7e3d870006eae7fe3068730dc923964cc3f Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Mon, 12 Aug 2024 22:31:19 +0200 Subject: [PATCH] use target dir from input --- .github/workflows/build_and_deploy.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 690cb8a7..fdcfd13e 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -17,6 +17,11 @@ on: branches: - main workflow_dispatch: + inputs: + target_directory: + description: 'The directory to deploy the docs to' + required: true + default: 'dev' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -104,23 +109,6 @@ jobs: # Downloads to '/home/runner/work/docs/docs/html' path: html - - name: get directory name - # if this is a tag, use the tag name as the directory name else dev - env: - REF: ${{ github.ref }} - run: | - TAG="${GITHUB_REF/refs\/tags\/v/}" - VER="${TAG/a*/}" # remove alpha identifier - VER="${VER/b*/}" # remove beta identifier - VER="${VER/rc*/}" # remove rc identifier - VER="${VER/post*/}" # remove post identifier - - if [[ "$REF" == "refs/tags/v"* ]]; then - echo "branch_name=$VER" >> "$GITHUB_ENV" - else - echo "branch_name=dev" >> "$GITHUB_ENV" - fi - - name: Deploy 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 @@ -129,5 +117,5 @@ jobs: external_repository: napari/napari.github.io publish_dir: ./html publish_branch: gh-pages - destination_dir: ${{ env.branch_name }} + destination_dir: ${{ github.event.inputs.target_directory || 'dev' }} cname: napari.org