1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
name: Build Docs
on:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
build-napari-docs:
name: Build docs on napari/docs
runs-on: ubuntu-latest
steps:
- 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: Trigger workflow and wait
uses: convictional/trigger-workflow-and-wait@f69fa9eedd3c62a599220f4d5745230e237904be # v1.6.5
with:
owner: napari
repo: docs
github_token: ${{ secrets.ACTIONS_DEPLOY_DOCS }}
workflow_file_name: build_and_deploy.yml
trigger_workflow: true
wait_workflow: true
client_payload: '{"target_directory": "${{ env.branch_name }}"}'
|