-
Notifications
You must be signed in to change notification settings - Fork 2.2k
49 lines (45 loc) · 1.29 KB
/
publish.yml
File metadata and controls
49 lines (45 loc) · 1.29 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
name: Publish Documentation
run-name: Publish by @${{ github.actor }}
on:
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up Python 3.13 + uv
uses: "./.github/actions/uv_setup"
id: setup-python
with:
python-version: '3.13'
- name: Install dependencies
shell: bash
run: uv sync --group test
- name: Build documentation
run: make build
- name: Verify build output exists
run: |
if [ ! -d build ]; then
echo "Error: build/ directory was not created."
exit 1
fi
- name: Prepare publish directory with nested build/
run: |
mkdir public
cp -r ./build public/build
- name: Publish to prod branch under /build
uses: peaceiris/actions-gh-pages@v4
with:
# this token lets the Action push to prod
github_token: ${{ secrets.GITHUB_TOKEN }}
# point to your generated site
publish_dir: ./public
# target branch (will be created if it doesn’t exist, or force‐updated if it does)
publish_branch: prod