Repository navigation
113 lines (106 loc) · 4.09 KB
/
Copy pathdocs.yaml
File metadata and controls
113 lines (106 loc) · 4.09 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Documentation
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- '**'
permissions: {}
concurrency:
# Versioned docs update the same Git branch and Pages deployment, so publish
# jobs must run one at a time. Do not cancel queued release-tag deploys.
group: pages
cancel-in-progress: false
jobs:
build:
# Pushes are published by the deploy job. This job keeps PR docs checks fast
# without building the same commit twice.
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.14'
- name: Install uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: '0.12.17'
- name: Install documentation dependencies
run: make docs-install
- name: Configure git identity
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Build versioned documentation
run: |
# Exercise the same `mike deploy` and export path used by releases,
# but on a local throwaway branch with no push, alias, or default.
VERSION=pr-preview \
DOCS_DEPLOY_BRANCH=docs-preview \
MIKE_FLAGS="--ignore-remote-status" \
make docs-deploy
DOCS_DEPLOY_BRANCH=docs-preview \
DOCS_EXPORT_DIR=site-versioned \
make docs-export
deploy:
# Release tags publish stable docs. Master publishes the moving `dev`
# version without moving the `latest` alias or default version.
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
# `mike` stores the complete versioned site on `gh-pages`.
contents: write
# GitHub Pages still publishes from this workflow's uploaded artifact.
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
# `mike` needs the existing `gh-pages` branch history so each release
# adds one version without dropping older versions.
fetch-depth: 0
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.14'
- name: Install uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: '0.12.17'
- name: Install documentation dependencies
run: make docs-install
- name: Configure git identity
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Build and export documentation version
run: |
if [ "$GITHUB_REF" = "refs/heads/master" ]; then
# Publish current master as moving development docs only.
make docs-deploy VERSION=dev PUSH=1
else
VERSION="${GITHUB_REF_NAME#v}"
# Build this tag into the version store, mark it as the only `latest`,
# then export the full versioned site for GitHub Actions Pages.
make docs-deploy VERSION="$VERSION" ALIASES=latest
make docs-set-default DEFAULT_VERSION=latest PUSH=1
fi
make docs-export
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: site-versioned
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5