Skip to content

Commit

Permalink
use target dir from input
Browse files Browse the repository at this point in the history
  • Loading branch information
Czaki committed Aug 12, 2024
1 parent 24d021b commit fc51a7e
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit fc51a7e

Please sign in to comment.