Skip to content

Commit a1382e8

Browse files
This commit adds MkDocs to the project for documentation generation.
- Adds mkdocs and mkdocs-material as development dependencies. - Creates a mkdocs.yml configuration file. - Creates an initial docs/index.md file. - Updates .gitignore to exclude the site/ directory. - Adds a build-docs job to the CI/CD pipeline to build the documentation.
1 parent fa79afb commit a1382e8

6 files changed

Lines changed: 657 additions & 4 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,42 @@ jobs:
7575
fail_ci_if_error: true
7676
verbose: true
7777

78+
build-docs:
79+
needs: test
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
83+
- name: Set up Python
84+
uses: actions/setup-python@cfd55ca82492758d853442341ad4d8010466803a
85+
with:
86+
python-version: '3.12'
87+
88+
- name: Install Poetry
89+
uses: snok/install-poetry@ff8a7d7de27005376176819789742a2280cc35e2
90+
91+
- name: Configure Poetry
92+
run: poetry config virtualenvs.in-project true
93+
shell: bash
94+
95+
- name: Cache dependencies
96+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
97+
with:
98+
path: .venv
99+
key: v1-${{ runner.os }}-python-3.12-${{ hashFiles('**/poetry.lock') }}
100+
restore-keys: |
101+
v1-${{ runner.os }}-python-3.12-
102+
103+
- name: Install dependencies
104+
run: poetry install --no-interaction --no-root
105+
shell: bash
106+
107+
- name: Build documentation
108+
run: poetry run mkdocs build --strict
109+
shell: bash
110+
78111
release:
79112
if: startsWith(github.ref, 'refs/tags/v')
80-
needs: test
113+
needs: build-docs
81114
runs-on: ubuntu-latest
82115
permissions:
83116
id-token: write

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ venv.bak/
128128
.ropeproject
129129

130130
# mkdocs documentation
131-
/site
131+
site/
132132

133133
# mypy
134134
.mypy_cache/

docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Welcome to my_python_project!
2+
3+
This is the main page of your project's documentation.

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
site_name: my_python_project
2+
theme:
3+
name: material

0 commit comments

Comments
 (0)