From 9c96e8ecdf0e09bc051f5d1ec12965bd43089f00 Mon Sep 17 00:00:00 2001 From: T-Crypt <132922589+T-Crypt@users.noreply.github.com> Date: Wed, 21 Oct 2026 14:14:16 -0600 Subject: [PATCH] docs: publish docs/ as a site on GitHub Pages MkDocs Material builds docs/ with --strict, so a broken link or a page missing from the nav fails the build. Pull requests that touch the docs run the build; a push to main also deploys it through GitHub's Pages actions, with no write access to the repository and no gh-pages branch. The theme uses system fonts: its default loads Google Fonts, which hands every visitor's address to Google. mkdocs and mkdocs-material are pinned; MkDocs 2.0 drops the plugin and theme system Material is built on. --- .github/workflows/docs.yml | 48 ++++++++++++++++++++++++++++++++++++++ .gitignore | 3 +++ docs/requirements.txt | 2 ++ mkdocs.yml | 48 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 docs/requirements.txt create mode 100644 mkdocs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..cf91267 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,48 @@ +name: docs + +on: + push: + branches: [main] + paths: [docs/**, mkdocs.yml, .github/workflows/docs.yml] + pull_request: + paths: [docs/**, mkdocs.yml, .github/workflows/docs.yml] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7.0.1 + - uses: actions/setup-python@v7.0.0 + with: + python-version: "3.13" + cache: pip + cache-dependency-path: docs/requirements.txt + - run: pip install -r docs/requirements.txt + # --strict fails the build on a broken link or a page missing from nav. + - run: mkdocs build --strict + - if: github.event_name != 'pull_request' + uses: actions/upload-pages-artifact@v5.0.0 + with: + path: site + + deploy: + if: github.event_name != 'pull_request' + needs: build + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v5.0.1 diff --git a/.gitignore b/.gitignore index 4e9159c..d09b67a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ bin/ # the binary a plain `go build` leaves at the root: untracked, it marks every later build +dirty /berth /berth.exe + +# mkdocs build output +/site/ diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..0c525b8 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +mkdocs==1.6.1 +mkdocs-material==9.7.7 diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..15fee83 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,48 @@ +site_name: Berth +site_description: Decides who gets your GPU. Engines, games and GPU apps lease the card in turn. +site_url: https://t-crypt.github.io/berth/ +repo_url: https://github.com/T-Crypt/berth +repo_name: T-Crypt/berth +edit_uri: edit/main/docs/ +copyright: Copyright 2026 Trevin Tindall (T-Crypt). Apache-2.0. + +theme: + name: material + # System fonts: the default loads Google Fonts, which hands every visitor's address to Google. + font: false + palette: + scheme: slate + primary: black + accent: light blue + features: + - navigation.instant + - navigation.top + - navigation.footer + - search.highlight + - content.code.copy + - content.action.edit + +nav: + - Overview: README.md + - Install: install.md + - Engines: engines.md + - Leasing, games and holds: leasing.md + - Models: models.md + - Gateway: gateway.md + - The harbor and telemetry: harbor.md + - Interfaces: interfaces.md + - Benchmarks: benchmarks.md + - Roadmap: roadmap.md + - FAQ: faq.md + +markdown_extensions: + - tables + - attr_list + - md_in_html + - toc: + permalink: true + - pymdownx.superfences + +validation: + links: + anchors: warn