-
Notifications
You must be signed in to change notification settings - Fork 171
63 lines (52 loc) · 1.67 KB
/
Copy pathdocs-preview.yml
File metadata and controls
63 lines (52 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
name: Docs Preview
on:
pull_request:
types: [opened, reopened, synchronize, closed]
paths:
- "docs/**"
- "toqito/**"
- ".github/workflows/docs-preview.yml"
# Shared with .github/workflows/docs.yml — mike deploys and preview cleanups
# both write to gh-pages, so they must not run concurrently or one push will
# be rejected as non-fast-forward.
concurrency:
group: gh-pages-deploy
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
jobs:
preview:
runs-on: ubuntu-latest
# Fork PRs cannot push to gh-pages; they must build docs locally.
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v7
- name: Set up Python
if: github.event.action != 'closed'
uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Install system dependencies for BLAS/LAPACK
if: github.event.action != 'closed'
run: |
sudo apt-get update
sudo apt-get install -y libblas-dev liblapack-dev gfortran libatlas-base-dev
- name: Install uv
if: github.event.action != 'closed'
uses: astral-sh/setup-uv@v7
- name: Install dependencies with uv
if: github.event.action != 'closed'
run: uv sync --group docs
- name: Build docs
if: github.event.action != 'closed'
run: |
cd docs
uv run mkdocs build --strict
- name: Deploy PR preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: docs/site/
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto