-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.62 KB
/
docs.yml
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
name: Documentation Building
on:
push:
branches:
- main
- master
workflow_dispatch: {}
jobs:
docs:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: yezz123/setup-uv@v4
- name: Install Dependencies
run: |
cd Doc
uv pip install -r requirements.txt --system
- name: Fetch gh-pages
run: git fetch origin gh-pages --depth=1
- name: Build docs
run: |
cd Doc
sphinx-build -b html . build/html -a -j auto --keep-going
- name: Rename generated index.html
run: |
mv Doc/build/html/index.html Doc/build/html/indexcontent.html
- name: Create .nojekyll and index.html for redirection
run: |
touch Doc/build/html/.nojekyll
echo "<!DOCTYPE HTML>
<html lang='en-US'>
<head>
<title>Page Redirection</title>
<meta charset='UTF-8'>
<meta http-equiv='refresh' content='0; url=indexcontent.html'>
<script type='text/javascript'>window.location.href = 'indexcontent.html'</script>
</head>
<body>
You are being redirected. If this does not work, click <a href='indexcontent.html'>this link</a>
</body>
</html>" > Doc/build/html/index.html
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: Doc/build/html