Skip to content

Commit 7443a4e

Browse files
committed
Initial commit
0 parents  commit 7443a4e

File tree

16 files changed

+1941
-0
lines changed

16 files changed

+1941
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Deploy MkDocs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- site
7+
repository_dispatch:
8+
types: [modules-updated]
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout site branch
25+
uses: actions/checkout@v4
26+
27+
- name: Checkout master branch content
28+
uses: actions/checkout@v4
29+
with:
30+
ref: master
31+
path: master-content
32+
33+
- name: Copy module content from master
34+
run: |
35+
# Copy each module directory from master to docs/
36+
for dir in master-content/mod-*/; do
37+
module=$(basename "$dir")
38+
rm -rf "docs/${module}"
39+
cp -r "$dir" "docs/"
40+
echo "Copied ${module}/"
41+
done
42+
# Clean up
43+
rm -rf master-content
44+
echo "=== Module files in docs/ ==="
45+
ls -la docs/mod-* | head -30
46+
47+
- name: Setup Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: '3.12'
51+
52+
- name: Install dependencies
53+
run: pip install -r requirements.txt
54+
55+
- name: Update navigation from H1 titles
56+
run: python scripts/update_nav.py
57+
58+
- name: Build site
59+
run: mkdocs build
60+
61+
- name: Upload artifact
62+
uses: actions/upload-pages-artifact@v3
63+
with:
64+
path: ./site
65+
66+
deploy:
67+
environment:
68+
name: github-pages
69+
url: ${{ steps.deployment.outputs.page_url }}
70+
runs-on: ubuntu-latest
71+
needs: build
72+
steps:
73+
- name: Deploy to GitHub Pages
74+
id: deployment
75+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Build artifacts
2+
site/
3+
4+
# Module content (fetched from master during build)
5+
docs/mod-*/
6+
7+
# Python virtual environment
8+
.venv/
9+
venv/
10+
env/
11+
12+
# Python cache
13+
__pycache__/
14+
*.py[cod]
15+
*$py.class
16+
17+
# IDE
18+
.vscode/
19+
.idea/
20+
21+
# OS
22+
.DS_Store
23+
Thumbs.db

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Modules - Site Branch
2+
3+
This branch contains the MkDocs build configuration for the MICRORACK Modules documentation.
4+
5+
**⚠️ Do not edit content here directly!** Edit the source markdown files in the `master` branch instead.
6+
7+
## How it works
8+
9+
1. Content is edited in the `master` branch (bare markdown files)
10+
2. GitHub Actions automatically syncs content to this branch
11+
3. MkDocs builds and deploys to GitHub Pages
12+
13+
## Branch Structure
14+
15+
### Master Branch (source - bare markdown)
16+
```
17+
repo/
18+
├── README.md # Index page content
19+
├── LICENSE.md # License file
20+
├── .github/
21+
│ └── workflows/
22+
│ └── sync-to-site.yml # Sync workflow
23+
├── mod-vco/
24+
│ ├── README.md
25+
│ └── mod-vco.png
26+
├── mod-vcf/
27+
│ ├── README.md
28+
│ └── mod-vcf.png
29+
└── ... (other modules)
30+
```
31+
32+
### Site Branch (this branch)
33+
```
34+
repo/
35+
├── README.md # This file
36+
├── mkdocs.yml # MkDocs configuration
37+
├── requirements.txt # Python dependencies
38+
├── scripts/
39+
│ └── convert_admonitions.py
40+
├── .github/
41+
│ └── workflows/
42+
│ └── deploy.yml # Deploy workflow
43+
└── docs/
44+
├── index.md # ← synced from master/README.md
45+
├── LICENSE.md # ← synced from master/LICENSE.md
46+
├── CNAME
47+
├── assets/ # CSS, JS, logos, fonts
48+
└── mod-*/ # ← synced from master/mod-*/
49+
```
50+
51+
## Local Development
52+
53+
```bash
54+
pip install -r requirements.txt
55+
mkdocs serve
56+
```
57+
58+
Visit http://127.0.0.1:8000
59+
60+
## GitHub Configuration
61+
62+
After creating the site branch:
63+
64+
1. **GitHub Pages Settings** (Settings → Pages):
65+
- Source: `GitHub Actions`
66+
67+
2. **Add site branch to allowed deployment branches**:
68+
```bash
69+
gh api repos/OWNER/REPO/environments/github-pages/deployment-branch-policies \
70+
--method POST -f name=site
71+
```
72+
73+
3. **Actions Permissions** (Settings → Actions → General):
74+
- Workflow permissions: Read and write permissions

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
modules.microrack.org

0 commit comments

Comments
 (0)