imporve documentation development

This commit is contained in:
ohdearaugustin 2024-05-31 23:39:07 +02:00
parent 5f9c26930c
commit ecfe859a2e
7 changed files with 1069 additions and 34 deletions

View File

@ -1,27 +1,27 @@
name: Test documentation build name: Test documentation build
on: [pull_request] on:
pull_request:
paths:
- 'docs/**'
- pyproject.toml
- poetry.lock
concurrency: concurrency:
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
cancel-in-progress: true cancel-in-progress: true
permissions:
id-token: write
contents: read
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install python - uses: DeterminateSystems/nix-installer-action@main
uses: actions/setup-python@v4 - uses: DeterminateSystems/magic-nix-cache-action@main
with: - name: Run tests
python-version: 3.x run: nix develop --command -- poetry run mkdocs build --strict
- name: Setup cache
uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- name: Setup dependencies
run: pip install -r docs/requirements.txt
- name: Build docs
run: mkdocs build --strict

View File

@ -4,6 +4,10 @@ on:
push: push:
branches: branches:
- main - main
paths:
- 'docs/**'
- pyproject.toml
- poetry.lock
workflow_dispatch: workflow_dispatch:
permissions: permissions:
@ -17,19 +21,10 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install python - uses: DeterminateSystems/nix-installer-action@main
uses: actions/setup-python@v4 - uses: DeterminateSystems/magic-nix-cache-action@main
with: - name: Run tests
python-version: 3.x run: nix develop --command -- poetry run mkdocs build --strict
- name: Setup cache
uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- name: Setup dependencies
run: pip install -r docs/requirements.txt
- name: Build docs
run: mkdocs build --strict
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
with: with:
@ -39,9 +34,6 @@ jobs:
environment: environment:
name: github-pages name: github-pages
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
steps: steps:

View File

@ -52,3 +52,9 @@ compress: build
generate: generate:
rm -rf gen rm -rf gen
buf generate proto buf generate proto
docs-serve:
poetry run mkdocs serve
docs-build:
poetry run mkdocs build

View File

@ -1,4 +0,0 @@
cairosvg~=2.7.1
mkdocs-material~=9.5.18
mkdocs-minify-plugin~=0.7.1
pillow~=10.1.0

View File

@ -90,6 +90,10 @@
protoc-gen-grpc-gateway protoc-gen-grpc-gateway
buf buf
clang-tools # clang-format clang-tools # clang-format
# Docu dependencies
python311
poetry
]; ];
# Add entry to build a docker image with headscale # Add entry to build a docker image with headscale

1018
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

19
pyproject.toml Normal file
View File

@ -0,0 +1,19 @@
[tool.poetry]
name = "docs"
version = "0.1.0"
description = ""
authors = ["ohdearaugustin <ohdearaugustin@users.noreply.github.com>"]
package-mode = false
[tool.poetry.dependencies]
python = "^3.11"
cairosvg = "^2.7.1,<2.8.0"
mkdocs = "^1.6.0,<1.7.0"
mkdocs-material = "^9.4.14"
mkdocs-minify-plugin = ">=0.7.1,<0.8.0"
pillow = ">=10.1.0,<10.2.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"