-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (60 loc) · 1.73 KB
/
builddocs.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
name: Generate documentation for gh-pages
env:
POETRY_VERSION: "1.2.0b1"
POETRY_VIRTUALENVS_IN_PROJECT: "false"
permissions:
contents: write
pull-requests: write
on:
push:
branches:
- main
workflow_dispatch:
inputs:
docstag:
description: "Tag for Documentation Building"
required: false
default: "dev"
jobs:
badges:
name: Documentation Badges
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry==${POETRY_VERSION}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
architecture: x64
cache: poetry
- run: poetry install --with dev --with docs
- run: poetry run python scripts/badges.py
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update documentation badges
push_options: '--force'
build-docs:
name: Build github pages
runs-on: ubuntu-latest
needs: badges
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: fregante/setup-git-user@v1
- name: Install poetry
run: pipx install poetry==${POETRY_VERSION}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
architecture: x64
cache: poetry
- run: poetry install --with docs
- run: poetry run mike deploy --push --update-aliases ${{github.event.inputs.docstag}}
if: ${{ github.event.inputs.docstag }}
- run: poetry run mike deploy --push --update-aliases main
if: ${{ github.event_name == 'push' }}