Skip to content

Commit acbaf4e

Browse files
committed
fix: docs deployment
1 parent eadb35b commit acbaf4e

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

.github/workflows/docs.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,28 @@ name: Docs
33
on:
44
pull_request:
55
branches: [main]
6+
workflow_dispatch: # Manual trigger
7+
workflow_run:
8+
workflows: ["Release"]
9+
types: [completed]
10+
11+
permissions:
12+
contents: write
613

714
jobs:
815
docs:
916
runs-on: ubuntu-latest
17+
# Run on PR, manual trigger, or successful Release
18+
if: |
19+
github.event_name == 'pull_request' ||
20+
github.event_name == 'workflow_dispatch' ||
21+
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
1022
1123
steps:
1224
- uses: actions/checkout@v6
25+
with:
26+
# For workflow_run, checkout the commit that triggered Release
27+
ref: ${{ github.event.workflow_run.head_sha || github.ref }}
1328

1429
- name: Install uv
1530
uses: astral-sh/setup-uv@v7
@@ -19,3 +34,11 @@ jobs:
1934

2035
- name: Build docs
2136
run: uv run mkdocs build
37+
38+
- name: Deploy to GitHub Pages
39+
# Deploy on manual trigger or after successful Release
40+
if: github.event_name != 'pull_request'
41+
uses: peaceiris/actions-gh-pages@v4
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
publish_dir: ./site

.github/workflows/release.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,3 @@ jobs:
2929
with:
3030
generate_release_notes: true
3131
files: dist/*
32-
33-
- name: Install docs dependencies
34-
run: uv sync --extra docs
35-
36-
- name: Build docs
37-
run: uv run mkdocs build
38-
39-
- name: Deploy to GitHub Pages
40-
uses: peaceiris/actions-gh-pages@v4
41-
with:
42-
github_token: ${{ secrets.GITHUB_TOKEN }}
43-
publish_dir: ./site

0 commit comments

Comments
 (0)