Skip to content

Commit f9597f3

Browse files
committed
Move to mkdocs
1 parent 2dadf30 commit f9597f3

29 files changed

+563
-1679
lines changed

.github/workflows/mkdocs.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: MkDocs
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
jobs:
19+
deploy-docs:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Generate token
23+
id: app-token
24+
uses: actions/create-github-app-token@v1
25+
with:
26+
app-id: ${{ secrets.APP_ID }}
27+
private-key: ${{ secrets.PRIVATE_KEY }}
28+
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
token: "${{ steps.app-token.outputs.token }}"
33+
34+
# Make the github application be the committer
35+
# (see: https://stackoverflow.com/a/74071223 on how to obtain the committer email)
36+
- name: Setup git config
37+
run: |
38+
git config --global user.name "py-mine-ci-bot"
39+
git config --global user.email "121461646+py-mine-ci-bot[bot]@users.noreply.github.com"
40+
41+
- name: Setup poetry
42+
id: poetry_setup
43+
uses: ItsDrike/setup-poetry@v1
44+
with:
45+
python-version: 3.12
46+
install-args: "--only main,docs"
47+
48+
- name: Generate docs directory hash
49+
run: |
50+
docs_dir_hash="$(find "./docs" -type f -exec sha256sum {} + | sort | sha256sum | awk '{print $1}')"
51+
echo "docs_dir_hash=$docs_hash" >> $GITHUB_ENV
52+
53+
- name: Restore MkDocs cache
54+
uses: actions/cache@v4
55+
with:
56+
path: .cache
57+
key:
58+
"mkdocs-material-${{ steps.poetry_setup.outputs.python-version }}-\
59+
${{ hashFiles('./poetry.lock') }}-${{ hashFiles('./mkdocs.yml') }}-\
60+
${{ env.docs_dir_hash }}"
61+
restore-keys: "mkdocs-material-${{ steps.poetry_setup.outputs.python-version }}-"
62+
63+
- name: Build the documentation
64+
run: poetry run mkdocs build
65+
66+
- name: Deploy preview
67+
if: ${{ github.event_name == 'pull_request' }}
68+
uses: rossjrw/pr-preview-action@v1
69+
with:
70+
source-dir: ./site
71+
preview-branch: gh-pages
72+
umbrella-dir: pr-preview
73+
token: ${{ steps.app-token.outputs.token }}
74+
75+
- name: Deploy production
76+
if: ${{ github.event_name == 'push' }}
77+
uses: JamesIves/github-pages-deploy-action@v4
78+
with:
79+
branch: gh-pages
80+
folder: ./site
81+
clean-exclude: pr-preview/
82+
token: ${{ steps.app-token.outputs.token }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ htmlcov/
2020
.coverage*
2121
coverage.xml
2222

23-
# Sphinx documentation
24-
docs/_build/
23+
# Mkdocs documentation
24+
site/
2525

2626
# Pyenv local version information
2727
.python-version

.readthedocs.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/_static/extra.css

Lines changed: 0 additions & 119 deletions
This file was deleted.

docs/_static/extra.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/api/basic.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/api/internal.rst

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/api/packets.rst

Lines changed: 0 additions & 45 deletions
This file was deleted.

docs/api/protocol.rst

Lines changed: 0 additions & 24 deletions
This file was deleted.

docs/api/types/index.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)