-
Notifications
You must be signed in to change notification settings - Fork 58
70 lines (59 loc) · 1.99 KB
/
Copy pathdocs.yml
File metadata and controls
70 lines (59 loc) · 1.99 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
name: Docs
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'zensical.toml'
- 'pyproject.toml'
- '.github/workflows/docs.yml'
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
# Both jobs push to the shared gh-pages branch via mike. Serialize runs so a
# second deploy never builds on a gh-pages tip the first has already moved
# past (which mike's push would then reject as non-fast-forward).
concurrency:
group: docs-deploy
cancel-in-progress: false
jobs:
# Only deploy from the upstream repo, not from forks (forks don't
# have write access to gh-pages and would fail).
deploy-prerelease:
if: github.repository_owner == 'PHPantom-dev' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Deploy prerelease docs
env:
MKDOCS_SITE_NAME: "PHPantom Docs (prerelease)"
MKDOCS_PRIMARY_COLOR: "blue grey"
run: uv run -- mike deploy --push --update-aliases prerelease
deploy-release:
if: github.repository_owner == 'PHPantom-dev' && github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Deploy versioned docs
run: |
version="${GITHUB_REF_NAME}"
uv run -- mike deploy --push --update-aliases "$version" latest
uv run -- mike set-default --push latest