-
Notifications
You must be signed in to change notification settings - Fork 52
63 lines (53 loc) · 1.72 KB
/
Copy pathdocs.yml
File metadata and controls
63 lines (53 loc) · 1.72 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
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'zensical.toml'
- 'pyproject.toml'
- '.github/workflows/docs.yml'
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
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