summaryrefslogtreecommitdiffstats
path: root/.github/workflows/docs.yml
blob: eeaaf405163306f2057a390d86177255615b7e83 (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
name: docs
on:
  workflow_dispatch:
  push:
    branches:
      - master
    paths:
      - 'docs/**'
      - '.github/workflows/docs.yml'

env:
  # Assign commit authorship to official Github Actions bot when pushing to the `gh-pages` branch:
  GIT_USER: 'github-actions[bot]'
  GIT_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com'

jobs:
  build-documentation:
    name: Build and deploy docs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - uses: actions/setup-python@v2
        with:
          python-version: 3.x

      - run: pip install mkdocs-material==7.2.6

      - run: pip install mdx_truly_sane_lists==1.2

      - run: pip install mike==1.1.0

      - name: Configure git user and email
        run: |
          git config --global user.name ${GIT_USER}
          git config --global user.email ${GIT_EMAIL}
          echo Name: $(git config --get user.name)
          echo Email: $(git config --get user.email)

      - name: Build and deploy docs with mike
        run: |
          cd docs
          mike deploy nightly --push