From 681398dda889cebc9c6fabc740df2a4f247a5712 Mon Sep 17 00:00:00 2001 From: Samu Lang Date: Sat, 31 Oct 2026 16:03:51 +0000 Subject: [PATCH] Deploy docs to GitHub Pages on release --- .github/workflows/docs.yml | 46 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 8 ++++++ README.md | 4 ++- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..e21da3a --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,46 @@ +name: Docs + +on: + workflow_call: + workflow_dispatch: + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + + - name: Restore tools + run: dotnet tool restore + + - name: Docs + run: dotnet docfx docs/docfx.json + + - uses: actions/upload-pages-artifact@v5 + with: + path: docs/_site + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + permissions: + pages: write + id-token: write + + steps: + - uses: actions/deploy-pages@v5 + id: deployment diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88f65fb..61c378b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,3 +41,11 @@ jobs: GH_TOKEN: ${{ github.token }} TAG: ${{ github.event.release.tag_name }} run: gh release upload "$TAG" artifacts/* --clobber + + docs: + needs: release + permissions: + contents: read + pages: write + id-token: write + uses: ./.github/workflows/docs.yml diff --git a/README.md b/README.md index 5708287..52b33c0 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ See the [package README](TheODI.NamedQuery/README.md) for setup, the manifest re # Docs -The package README and an API reference generated from the XML docs are built into a [DocFX](https://dotnet.github.io/docfx/) site in `docs/`. To build and serve it locally at http://localhost:8080: +The package README and an API reference generated from the XML docs are built into a [DocFX](https://dotnet.github.io/docfx/) site in `docs/`, published at https://theodi.github.io/NamedQuery/. To build and serve it locally at http://localhost:8080: ```shell dotnet tool restore @@ -55,6 +55,8 @@ dotnet test --solution NamedQuery.slnx Publishing a GitHub release whose tag is `v` followed by the version (e.g. `v0.1.0-alpha.1`) runs the [release workflow](.github/workflows/release.yml). It tests, packs the library with that version, pushes it to NuGet and attaches the packages to the release. Mark versions with a `-` suffix as pre-releases. +A release also deploys the docs site to [GitHub Pages](https://theodi.github.io/NamedQuery/) with the [docs workflow](.github/workflows/docs.yml), which can also be run by hand from the Actions tab ("Docs"). + # MCP Each endpoint is also exposed as a read-only tool on the [MCP](https://modelcontextprotocol.io) server at `/mcp` (Streamable HTTP). Tool names are endpoint paths with characters other than letters, digits, `_` and `-` replaced by `_`.