-
Notifications
You must be signed in to change notification settings - Fork 18
74 lines (71 loc) · 2.18 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
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build Docs
on: [push]
jobs:
docs:
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Setup Python # Set Python version
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install poetry
poetry config virtualenvs.create false
python -m pip install --upgrade pip
# Can't skip optional deps with poetry install -v
# poetry install -v
python -m pip install .
- name: Build docs
run: |
python -m pip install -r docs/requirements.txt
python -m ipykernel install --user --name python --display-name python
python -m ipykernel install --user --name python3 --display-name python3
cd docs
cp ../README.md index.md
cp ../example.png example.png
cp ../example2.png example2.png
# cp ../logo.png logo.png
cd ..
mkdocs build
if : success()
- name: Deploy docs
run: |
mkdocs gh-deploy --clean --force
# if: success() && github.ref == 'refs/heads/master'
fix-index:
needs: docs
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- name: Fix index.html
run: |
echo ':: head of index.html - before ::'
head index.html
sed -i '1,5{/^$/d}' index.html
echo ':: head of index.html - after ::'
head index.html
if: success()
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Add changes" -a
if: success()
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
if: success()