File: deploy_docs.yml

package info (click to toggle)
napari 0.6.6-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,036 kB
  • sloc: python: 112,264; xml: 72; makefile: 44; sh: 5
file content (46 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download
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 }}"}'