-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 1.67 KB
/
docs.yml
File metadata and controls
74 lines (63 loc) · 1.67 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
name: Documentation
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
- '**/README.md'
- '**/.env.example'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Fetch all history for sphinx-multiversion
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
- name: Check README sync
working-directory: docs
run: make sync-check
- name: Build documentation
working-directory: docs
run: make build
- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: docs-${{ github.sha }}
path: docs/_build/html
retention-days: 30
deploy:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download documentation artifact
uses: actions/download-artifact@v4
with:
name: docs-${{ github.sha }}
path: ./docs
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GHCR_PAT }}
publish_dir: ./docs
keep_files: true
enable_jekyll: false