-
Notifications
You must be signed in to change notification settings - Fork 7
57 lines (51 loc) · 1.53 KB
/
docs-preview.yml
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
name: "Sphinx: Preview docs"
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
branches:
- "**"
paths:
# Run for changes to *this* workflow file, but not for other workflows
- ".github/workflows/docs-preview.yml"
# Trigger off docs and Python source code changes
- "docs/**"
- "src/**.py"
concurrency: preview-${{ github.ref }}
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Not actually a matrix build, but defined as one for consistency
max-parallel: 1
matrix:
python-version: [3.12]
os: [ubuntu-latest]
permissions:
# Allow updating the gh-pages branch
contents: write
# Allow posting a PR comment with a preview link
pull-requests: write
# Check https://github.com/actions/action-versions/tree/main/config/actions
# for latest versions if the standard actions start emitting warnings
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build HTML
uses: ammaraskar/[email protected]
if: github.event.action != 'closed'
with:
docs-folder: "docs/"
pre-build-command: "sphinx-build -W -b linkcheck . _build"
build-command: "sphinx-build -W -b dirhtml . _build"
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
source-dir: docs/_build/
preview-branch: gh-pages
custom-url: venvstacks.lmstudio.ai