summaryrefslogtreecommitdiffstats
path: root/.github/workflows/publish-docs.yml
blob: b882c39f8905ce4571923942591dff685810d3e7 (plain)
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
47
48
49
50
name: Publish Docs
run-name: "Publish Docs (docs_version=${{ inputs.docs_version }})"

on:
  workflow_call:
    inputs:
      docs_version:
        description: "Version to build docs for (dev | latest | 0.19.x | ...)"
        required: true
        type: string
  workflow_dispatch:
    inputs:
      docs_version:
        description: "Version to build docs for (dev | latest | 0.19.x | ...)"
        type: string
        default: dev
  
permissions:
  contents: write

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:

      # Checkout the gh-pages branch, we need to commit the docs to this branch below
      - uses: actions/checkout@v3.3.0
        with:
          ref: gh-pages
      
      #  Now checkout the git ref on which we're working
      - uses: actions/checkout@v3.3.0

      - uses: actions/setup-python@v4.6.1
        with:
          python-version: 3.11

      - name: Install Hatch
        run: python -m pip install hatch==1.7.0

      - name: Configure Git for GitHub Actions bot
        run: |
          git config --local user.name 'github-actions[bot]'
          git config --local user.email 'github-actions[bot]@users.noreply.github.com'

      - name: Deploy dev docs
        run: hatch run docs:mike deploy --push --update-aliases ${{ inputs.docs_version }}

      # Note that it will take a few mins after this workflow has finished for the docs to be available on
      # http://jorisroovers.github.io/gitlint