-
Notifications
You must be signed in to change notification settings - Fork 56
58 lines (50 loc) · 1.61 KB
/
Copy pathdocs.yaml
File metadata and controls
58 lines (50 loc) · 1.61 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
name: Documentation
on:
workflow_call:
inputs:
version:
description: 'Version to deploy (e.g. v1.2.3)'
type: string
required: true
push:
branches:
- main
pull_request:
branches:
- main
paths:
- ".github/workflows/docs.yaml"
- "docs/**"
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0 # Fetch all branches to include 'gh-pages' branch
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990
with:
enable-cache: true
- name: Install dependencies
run: uv sync --frozen
- name: Lint Markdown files
uses: DavidAnson/markdownlint-cli2-action@6bf21b07787794f89a243495939cd651942aeabe # v24
with:
config: 'docs/.markdownlint.jsonc'
globs: 'docs/**/*.md'
- name: Build pages
run: uv run mkdocs build --strict
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Deploy pages (unstable)
if: github.ref == 'refs/heads/main'
run: uv run mike deploy --push --update-aliases unstable
- name: Deploy pages (new release)
if: github.event_name == 'workflow_call'
run: |
uv run mike deploy --push --update-aliases ${{ inputs.version }} latest
echo "Deployed version ${{ inputs.version }} to GitHub Pages"