Repository navigation
79 lines (72 loc) · 2.31 KB
/
Copy pathdocs.yml
File metadata and controls
79 lines (72 loc) · 2.31 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Documentation
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
concurrency:
group: documentation-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
changes:
uses: ./.github/workflows/changes.yml
build:
needs: changes
# Main pushes always deploy: a newer push can cancel a docs-changing run, and
# its own diff would otherwise leave the site at the older commit.
if: ${{ !cancelled() && (github.event_name == 'push' || needs.changes.result != 'success' || needs.changes.outputs.docs == 'true') }}
name: Build documentation
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.11"
cache: pip
cache-dependency-path: docs/requirements.txt
- name: Install documentation dependencies
run: python -m pip install -r docs/requirements.txt
- name: Build documentation
run: mkdocs build --strict --config-file docs/mkdocs.yml
docs-result:
name: Documentation validation
needs: [changes, build]
if: ${{ always() }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require selected documentation build
env:
CHANGES_RESULT: ${{ needs.changes.result }}
DOCS_SELECTED: ${{ needs.changes.outputs.docs }}
MATRIX_RESULT: ${{ needs.build.result }}
run: |
if [ "$CHANGES_RESULT" = success ] && [ "$DOCS_SELECTED" = false ]; then
test "$MATRIX_RESULT" = skipped || test "$MATRIX_RESULT" = success
else
test "$MATRIX_RESULT" = success
fi
deploy:
name: Deploy documentation
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.11"
cache: pip
cache-dependency-path: docs/requirements.txt
- name: Install documentation dependencies
run: python -m pip install -r docs/requirements.txt
- name: Deploy to GitHub Pages
run: mkdocs gh-deploy --force --config-file docs/mkdocs.yml