Repository navigation
59 lines (49 loc) · 1.59 KB
/
Copy pathdeploy_docs.yml
File metadata and controls
59 lines (49 loc) · 1.59 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
name: Build and Deploy Documentation
# mike commits each version of the site to the gh-pages branch, which GitHub Pages serves.
on:
push:
branches:
- main
release:
types: [published]
permissions:
contents: write
concurrency:
group: docs
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python
run: uv python install
- name: Install the project
run: uv sync --all-extras --dev
- name: Configure Git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
# Rules added since the last release show "Unreleased" until their version is stamped in the
# source; the released docs show the version they ship in.
- name: Stamp unreleased rules
if: github.event_name == 'release'
env:
VERSION: ${{ github.event.release.tag_name }}
run: sed -i "s/\*\*Since\*\* \`Unreleased\`/**Since** \`$VERSION\`/" docs/reference/rules/*.md
- name: Build and push the docs
env:
VERSION: ${{ github.event.release.tag_name }}
run: |
if [ "${{ github.event_name }}" = "release" ]; then
uv run mike deploy --push --update-aliases "$VERSION" latest
uv run mike set-default --push latest
else
uv run mike deploy --push main
fi