-
-
Notifications
You must be signed in to change notification settings - Fork 42
74 lines (63 loc) · 1.87 KB
/
github-pages.yaml
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
name: Generate docs
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
pages:
runs-on: ubuntu-latest
strategy:
matrix:
docs:
# { ref: <branch/tag name>, name: <docs drop down entry> }
- { ref: main, name: latest }
- { ref: v0.2.1, name: 0.2.1 }
steps:
- uses: actions/checkout@v4
if: ${{ matrix.docs.ref == 'main' }}
- uses: actions/checkout@v4
with:
ref: ${{ matrix.docs.ref }}
if: ${{ matrix.docs.ref != 'main' }}
- uses: bazelbuild/setup-bazelisk@v3
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Generate docs
run: bash ./build-docs.sh
env:
CI: 1
working-directory: ${{ github.workspace }}/docs
- run: bazelisk shutdown
- uses: actions/upload-artifact@v4
with:
name: "${{ matrix.docs.name }}"
path: ${{ github.workspace }}/docs/site/
if-no-files-found: error
if: ${{ github.event_name != 'pull_request' }}
publish:
needs: pages
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/docs/generated
- name: Inspect docs site directory structure
run: find ${{ github.workspace }}/docs/generated -maxdepth 2
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: |
pip install packaging==23.*
python versioning.py generated/
working-directory: ${{ github.workspace }}/docs
- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/generated
force_orphan: true