Skip to content
Merged
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
80 changes: 80 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build and Deploy Documentation

on:
schedule:
# Run weekly on Sundays at midnight UTC
- cron: "0 0 * * 0"
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Resolve repository and book title
id: resolve
run: |
set -eo pipefail

REPO_INPUT="${{ github.event.inputs.repo }}"
if [ -n "$REPO_INPUT" ]; then
REPO_VALUE="$REPO_INPUT"
else
REPO_VALUE="${{ github.repository }}"
fi

TITLE_INPUT="${{ github.event.inputs.book_title }}"
if [ -n "$TITLE_INPUT" ]; then
TITLE_VALUE="$TITLE_INPUT"
else
REPO_NAME="${REPO_VALUE#*/}"
if [ -z "$REPO_NAME" ]; then
TITLE_VALUE="Documentation"
else
TITLE_VALUE="$REPO_NAME Documentation"
fi
fi

echo "repo_value=$REPO_VALUE" >> "$GITHUB_OUTPUT"
echo "title_value=$TITLE_VALUE" >> "$GITHUB_OUTPUT"
echo "Using repository: $REPO_VALUE"
echo "Using book title: $TITLE_VALUE"

- name: Prepare output directory
run: |
rm -rf output
mkdir -p output

- name: Generate DeepWiki docs
uses: jzombie/deepwiki-to-mdbook@main
with:
repo: ${{ steps.resolve.outputs.repo_value }}
book_title: ${{ steps.resolve.outputs.title_value }}
output_dir: ./output

- name: Upload artifact for Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./output/book

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<a href="https://www.rust-lang.org/"><img src="https://img.shields.io/badge/Made%20with-Rust-black?&logo=Rust" alt="made-with-rust"></a>
<a href="https://crates.io/crates/muxio"><img src="https://img.shields.io/crates/v/muxio.svg" alt="crates.io"></a>
<a href="https://docs.rs/muxio"><img src="https://docs.rs/muxio/badge.svg" alt="Documentation"></a>
<a href="https://deepwiki.com/jzombie/rust-muxio"><img src="https://deepwiki.com/badge.svg"></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="license"></a>
</div>

Expand Down