Skip to content

Commit bb22534

Browse files
committed
Use Github Pages for accessing docs
1 parent c3ee266 commit bb22534

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

.github/workflows/docs.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Docs
2+
3+
on:
4+
pull_request:
5+
branches: [main, master]
6+
push:
7+
branches: [main, master]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: pages
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build-docs:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.12"
29+
30+
- name: Install docs dependencies
31+
run: pip install -r requirements-docs.txt
32+
33+
- name: Build docs site
34+
run: mkdocs build --strict
35+
36+
- name: Upload built docs artifact
37+
if: github.event_name == 'pull_request'
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: docs-site
41+
path: site/
42+
43+
- name: Setup Pages
44+
if: github.event_name != 'pull_request'
45+
uses: actions/configure-pages@v5
46+
47+
- name: Upload Pages artifact
48+
if: github.event_name != 'pull_request'
49+
uses: actions/upload-pages-artifact@v3
50+
with:
51+
path: site/
52+
53+
deploy-docs:
54+
if: github.event_name != 'pull_request'
55+
needs: build-docs
56+
runs-on: ubuntu-latest
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

mkdocs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
site_name: Sensor Metrics Analyzer Docs
2+
site_description: Documentation for sensor-metrics-analyzer
3+
repo_url: https://github.com/stackrox/sensor-metrics-analyzer
4+
repo_name: stackrox/sensor-metrics-analyzer
5+
6+
theme:
7+
name: material
8+
9+
docs_dir: docs
10+
11+
nav:
12+
- Docs Home: README.md
13+
- Rules:
14+
- Rules Home: rules/README.md
15+
- Rule Types and Examples: rules/rule-types.md
16+
- Advanced Rule Features: rules/advanced-features.md
17+
- Load Detection Rules: rules/load-detection.md
18+
- Usage:
19+
- TUI Keyboard Shortcuts: usage/tui-shortcuts.md
20+
- Developer Guides:
21+
- Testing: dev/testing.md
22+
- Releasing a New Version: dev/releasing.md
23+
- Recording Demos: dev/recording-demos.md
24+
- Architecture:
25+
- Project Structure: architecture/project-structure.md
26+
27+
markdown_extensions:
28+
- tables
29+
- admonition
30+
- toc:
31+
permalink: true

requirements-docs.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mkdocs>=1.6
2+
mkdocs-material>=9.5

0 commit comments

Comments
 (0)