Repository navigation
75 lines (70 loc) · 2.39 KB
/
Copy pathdocumentation.yaml
File metadata and controls
75 lines (70 loc) · 2.39 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
71
72
73
74
75
name: Docs
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pages-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build documentation
if: github.repository == 'OptimalScale/LMFlow'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.2.0
with:
python-version: "3.11"
cache: pip
cache-dependency-path: docs/requirements.txt
- name: Install dependencies
run: python -m pip install -r docs/requirements.txt
- name: Build documentation
run: sphinx-build -b html -w _build/sphinx-warnings.log docs/source _build/html
- name: Check documentation links
run: python .github/scripts/check_doc_links.py _build/sphinx-warnings.log
- name: Upload documentation artifact
if: >-
github.repository == 'OptimalScale/LMFlow' &&
github.event_name != 'pull_request' &&
github.ref == 'refs/heads/main'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: documentation-html
path: _build/html
if-no-files-found: error
retention-days: 1
deploy:
name: Deploy documentation
if: >-
github.repository == 'OptimalScale/LMFlow' &&
github.event_name != 'pull_request' &&
github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2
- name: Download documentation artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: documentation-html
path: _build/html
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: _build/html
force_orphan: true