Skip to content

Commit 46e4102

Browse files
committed
docs: migrate documentation to mdBook with GitHub Pages deployment
Replace flat Markdown docs with mdBook, splitting content into structured chapters (Getting Started, User Guide, Advanced Usage, Reference). Add deploy-docs CI job that builds and deploys to GitHub Pages on push to main. Update Makefile with docs, docs-serve, and docs-api targets.
1 parent 92717cc commit 46e4102

36 files changed

Lines changed: 2000 additions & 990 deletions

.github/workflows/ci.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ name: CI
22

33
on:
44
push:
5-
branches: [ develop ]
5+
branches: [ main ]
66
pull_request:
7-
branches: [ develop ]
7+
branches: [ main ]
88

99
env:
1010
CARGO_TERM_COLOR: always
1111
RUST_BACKTRACE: 1
1212

13+
# Allow only one concurrent deployment to Pages
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
1318
jobs:
1419
test:
1520
name: Test
@@ -43,6 +48,36 @@ jobs:
4348
- name: Check formatting
4449
run: cargo fmt --all -- --check
4550

51+
deploy-docs:
52+
name: Deploy Docs
53+
runs-on: ubuntu-latest
54+
needs: test
55+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
56+
permissions:
57+
pages: write
58+
id-token: write
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
66+
- name: Install mdBook
67+
uses: peaceiris/actions-mdbook@v2
68+
with:
69+
mdbook-version: 'latest'
70+
71+
- name: Build documentation
72+
run: mdbook build
73+
74+
- name: Upload Pages artifact
75+
uses: actions/upload-pages-artifact@v3
76+
with:
77+
path: docs/book
4678

79+
- name: Deploy to GitHub Pages
80+
id: deployment
81+
uses: actions/deploy-pages@v4
4782

4883

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ config.local.json
4343

4444
# Documentation build artifacts
4545
docs/_build/
46+
docs/book/
4647
site/
4748

4849
# Temporary files
@@ -69,10 +70,6 @@ Thumbs.db
6970
coverage/
7071
*.profraw
7172

72-
# Documentation build
73-
docs/_build/
74-
site/
75-
7673
# Package files
7774
*.tar.gz
7875
*.zip

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Bayesian SSH Makefile
22
# Provides common development and build tasks
33

4-
.PHONY: help build test release clean install uninstall format lint check deps update-deps
4+
.PHONY: help build test release clean install uninstall format lint check deps update-deps docs docs-serve docs-api
55

66
# Configuration
77
BINARY_NAME = bayesian-ssh
@@ -143,10 +143,19 @@ quick: build test ## Quick build and test
143143
@echo "🎉 Quick build and test completed!"
144144

145145
# Documentation
146-
docs: ## Build documentation
146+
docs: ## Build documentation with mdBook
147147
@echo "📚 Building documentation..."
148+
mdbook build
149+
@echo "✅ Documentation built in docs/book/"
150+
151+
docs-serve: ## Serve documentation locally with live reload
152+
@echo "📚 Serving documentation..."
153+
mdbook serve --open
154+
155+
docs-api: ## Build Rust API documentation
156+
@echo "📚 Building API documentation..."
148157
$(CARGO) doc --no-deps --open
149-
@echo "Documentation built"
158+
@echo "API documentation built"
150159

151160
# Show binary info
152161
info: release ## Show binary information

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,19 @@ bayesian-ssh config --use-kerberos --default-user customuser
141141

142142
## Documentation
143143

144-
For comprehensive guides and advanced topics, see the [docs/](docs/) folder:
144+
Full documentation is built with [mdBook](https://rust-lang.github.io/mdBook/). To build and view locally:
145145

146-
- **[Technical Architecture](docs/technical-architecture.md)** - System design and architecture
147-
- **[Advanced Usage](docs/advanced-usage.md)** - Enterprise scenarios and complex use cases
148-
- **[Troubleshooting](docs/troubleshooting.md)** - Common issues and solutions
149-
- **[Documentation Index](docs/README.md)** - Complete documentation overview
146+
```bash
147+
make docs # Build to docs/book/
148+
make docs-serve # Serve locally with live reload
149+
```
150+
151+
Documentation covers:
152+
153+
- **[Getting Started](docs/src/getting-started/installation.md)** - Installation, quick start, configuration
154+
- **[User Guide](docs/src/user-guide/connection-management.md)** - Connections, sessions, aliases, TUI, bastion hosts
155+
- **[Advanced Usage](docs/src/advanced-usage/enterprise.md)** - Enterprise, cloud, CI/CD, security & compliance
156+
- **[Reference](docs/src/reference/architecture.md)** - Architecture, troubleshooting, changelog
150157

151158
## Changelog
152159
See [CHANGELOG.md](CHANGELOG.md) for detailed release notes.

book.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[book]
2+
title = "Bayesian SSH Documentation"
3+
authors = ["Abdoufermat5"]
4+
description = "Documentation for Bayesian SSH - An intelligent SSH session manager"
5+
src = "docs/src"
6+
language = "en"
7+
8+
[build]
9+
build-dir = "docs/book"
10+
11+
[output.html]
12+
default-theme = "navy"
13+
preferred-dark-theme = "navy"
14+
git-repository-url = "https://github.com/abdoufermat5/bayesian-ssh"
15+
edit-url-template = "https://github.com/abdoufermat5/bayesian-ssh/edit/main/{path}"
16+
site-url = "/bayesian-ssh/"

docs/README.md

Lines changed: 0 additions & 246 deletions
This file was deleted.

0 commit comments

Comments
 (0)