-
Notifications
You must be signed in to change notification settings - Fork 172
84 lines (72 loc) · 2.39 KB
/
Copy pathdocs.yml
File metadata and controls
84 lines (72 loc) · 2.39 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
75
76
77
78
79
80
81
82
83
84
name: Deploy Documentation
on:
push:
branches:
- master
paths:
- "docs/**"
- "toqito/**"
- ".github/workflows/docs.yml"
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: >-
Version to deploy as 'latest' (e.g. 1.1.8). Run the workflow from that version's tag so
the built docs match the release. Leave empty to deploy only the dev docs.
required: false
default: ""
permissions:
contents: write
# Serialize all writers of the gh-pages branch (this workflow + Docs Preview)
# so mike's deploy and rossjrw/pr-preview-action cleanup don't race each other
# and lose one of the pushes to a non-fast-forward rejection.
concurrency:
group: gh-pages-deploy
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Install system dependencies for BLAS/LAPACK
run: |
sudo apt-get update
sudo apt-get install -y libblas-dev liblapack-dev gfortran libatlas-base-dev
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies with uv
run: uv sync --group docs
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Deploy dev docs (push to master, or manual run without a version)
if: >-
github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && inputs.version == '')
run: |
cd docs
uv run mike deploy --push dev
- name: Deploy versioned docs (release, or manual run with a version)
if: >-
github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && inputs.version != '')
run: |
if [ "${{ github.event_name }}" = "release" ]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION="${{ inputs.version }}"
fi
VERSION=${VERSION#v}
VERSION=${VERSION#.}
cd docs
uv run mike deploy --push --update-aliases "$VERSION" latest
uv run mike set-default --push latest