-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.2 KB
/
docs.yml
File metadata and controls
46 lines (38 loc) · 1.2 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
name: Docs
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: # Manual trigger
workflow_run:
workflows: ["Release (Manual)", "Release Please"]
types: [completed]
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
# Run on PR, manual trigger, or successful Release
if: |
github.event_name == 'pull_request' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
steps:
- uses: actions/checkout@v6
with:
# For workflow_run, checkout the commit that triggered Release
ref: ${{ github.event.workflow_run.head_sha || github.ref }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv sync --extra docs
- name: Build docs
run: uv run mkdocs build
- name: Deploy to GitHub Pages
# Deploy on manual trigger or after successful Release
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site