From a9f1284fa6f36359e2722343cce5727607a2f18f Mon Sep 17 00:00:00 2001 From: oopsbagel Date: Sun, 11 May 2025 02:08:19 -0700 Subject: [PATCH] docs: publish mdbook in doc to github pages This commit adds an mdbook for rayhunter documentation in `doc`, and actions workflows to publish that documentation to github pages. This commit configures actions to publish to pages via artifact uploads, but but can be adjusted to publish based solely on a branch.[0] This was chosen to allow for future flexibility in generating multiple outputs (such as a single page html document or pdf). [0] https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site --- .github/workflows/mdbook.yaml | 47 +++++++++++++++++++++++++++++++++++ .gitignore | 1 + book.toml | 5 ++++ doc/SUMMARY.md | 4 +++ doc/installation.md | 1 + doc/supported_devices.md | 4 +++ 6 files changed, 62 insertions(+) create mode 100644 .github/workflows/mdbook.yaml create mode 100644 book.toml create mode 100644 doc/SUMMARY.md create mode 100644 doc/installation.md create mode 100644 doc/supported_devices.md diff --git a/.github/workflows/mdbook.yaml b/.github/workflows/mdbook.yaml new file mode 100644 index 0000000..7434dc0 --- /dev/null +++ b/.github/workflows/mdbook.yaml @@ -0,0 +1,47 @@ +# On Repository Settings > Pages > Build and deployment +# Set "Source" to GitHub Actions. +name: Documentation +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + mdbook_test: + name: Test mdBook Documentation builds + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install mdBook + run: | + cargo install mdbook --no-default-features --features search --vers "^0.4" --locked + - name: Test mdBook + run: mdbook test + + mdbook_publish: + if: ${{ github.event_name != 'pull_request' }} + needs: mdbook_test + permissions: + pages: write + contents: write + id-token: write + name: Publish mdBook to Github Pages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install mdBook + run: | + cargo install mdbook --no-default-features --features search --vers "^0.4" --locked + + - name: Build mdBook + run: mdbook build + + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: book + - name: Deploy to Github Pages + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index ea8c4bf..11e2b4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/book diff --git a/book.toml b/book.toml new file mode 100644 index 0000000..095b5bb --- /dev/null +++ b/book.toml @@ -0,0 +1,5 @@ +[book] +authors = ["the rayhunter Authors"] +language = "en" +src = "doc" +title = "rayhunter Documentation" diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md new file mode 100644 index 0000000..9bec737 --- /dev/null +++ b/doc/SUMMARY.md @@ -0,0 +1,4 @@ +# Summary + +- [Installation](./installation.md) +- [Supported Devices](./supported_devices.md) diff --git a/doc/installation.md b/doc/installation.md new file mode 100644 index 0000000..b743fda --- /dev/null +++ b/doc/installation.md @@ -0,0 +1 @@ +# Chapter 1 diff --git a/doc/supported_devices.md b/doc/supported_devices.md new file mode 100644 index 0000000..c4fdb21 --- /dev/null +++ b/doc/supported_devices.md @@ -0,0 +1,4 @@ +# Supported devices + +- Orbic RC400L +- TPLink M7350 HW rev. 3, 5, 9