-
Notifications
You must be signed in to change notification settings - Fork 3
93 lines (77 loc) · 2.89 KB
/
deploy-docs.yaml
File metadata and controls
93 lines (77 loc) · 2.89 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
name: Deploy docs
on: # yamllint disable-line rule:truthy
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]'
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions: {}
jobs:
build-docs:
runs-on: ubuntu-latest
strategy:
matrix:
pyversion: ["3.13"]
# Grant GITHUB_TOKEN the permissions required to make a gh-pages deployment
permissions:
contents: write # to let mkdocs write the new docs
pages: write # to deploy to Pages
id-token: write # allow to generate an OpenID Connect (OIDC) token
steps:
# https://github.com/actions/checkout
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Configure git for the bot
# Gives the bot that commits to gh-pages a name & email address
# so that the commits have an author in the commit log.
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
# https://github.com/astral-sh/setup-uv
- name: Install uv
uses: astral-sh/[email protected]
with:
python-version: ${{ matrix.pyversion }}
enable-cache: true
cache-dependency-glob: "uv.lock"
# https://github.com/actions/setup-python
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.pyversion }}
- name: Install just
run: |
uv tool install rust-just
- name: Install dependencies
run: uv sync --dev --no-progress
- name: Generate schema documentation
run: |
just gen-doc
# The if-conditions below make sure to select the right step, depending
# on the job trigger. Only one of the steps below will run at a time.
# The others will be skipped.
- name: Check docs in pull requests with strict mode
if: github.event_name == 'pull_request'
run: |
# XXX Enable strict mode once docs are clean
echo "Strict check of docs disabled."
# uv run mkdocs build --strict
# yamllint disable rule:line-length
- name: Build & deploy "dev" docs for a new commit to main
if: (github.event_name == 'push' && github.ref_type != 'tag') || github.event_name == 'workflow_dispatch'
run: |
export SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
uv run mike deploy --push --update-aliases --title "dev (${SHORT_SHA})" dev
- name: Build & deploy docs for a new version tag
if: github.ref_type == 'tag' && github.event_name == 'push'
run: |
uv run mike deploy --push --update-aliases ${{ github.ref_name }} latest
uv run mike set-default latest --push