Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imporve documentation development #1965

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/docs-test.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Test documentation build

on: [pull_request]
on:
pull_request:
paths:
- 'docs/**'
- pyproject.toml
- poetry.lock

concurrency:
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
id-token: write
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v4
with:
python-version: 3.x
- 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
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run tests
run: nix develop --command bash -c "poetry install && poetry run mkdocs build --strict"
24 changes: 8 additions & 16 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- main
paths:
- 'docs/**'
- pyproject.toml
- poetry.lock
workflow_dispatch:

permissions:
Expand All @@ -17,19 +21,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v4
with:
python-version: 3.x
- 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
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run tests
run: nix develop --command bash -c "poetry install && poetry run mkdocs build --strict"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand All @@ -39,9 +34,6 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
needs: build
steps:
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ compress: build
generate:
rm -rf gen
buf generate proto

docs-serve:
poetry run mkdocs serve

docs-build:
poetry run mkdocs build
4 changes: 0 additions & 4 deletions docs/requirements.txt

This file was deleted.

6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
protoc-gen-grpc-gateway
buf
clang-tools # clang-format

# Docu dependencies
python311
poetry
mkdocs
cairo
];

# Add entry to build a docker image with headscale
Expand Down
1,018 changes: 1,018 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tool.poetry]
name = "docs"
version = "0.1.0"
description = ""
authors = ["ohdearaugustin <[email protected]>"]
package-mode = false

[tool.poetry.dependencies]
python = "^3.11"
cairosvg = "^2.7.1,<2.8.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"
Loading