Skip to content

Commit 6940b3c

Browse files
authored
Add CI/CD for documentation (#45)
* add CI/CD for documentation automatically builds the docs and deploys the default branch * add permissions * fix mv * split deploy step fix duplicate action runs * add permissions * document private items --------- Co-authored-by: Gabriel <69007475+Friendly-Banana@users.noreply.github.com>
1 parent f3d0e5e commit 6940b3c

3 files changed

Lines changed: 222 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
3-
branches-ignore:
4-
- "gh-readonly-queue/**"
3+
branches:
4+
- 'main'
55
pull_request:
66
merge_group:
77
workflow_dispatch:
@@ -89,6 +89,8 @@ jobs:
8989
needs: [container]
9090
container:
9191
image: ${{ needs.container.outputs.container_name }}
92+
permissions:
93+
contents: read
9294
steps:
9395
- name: Checkout
9496
uses: actions/checkout@v4
@@ -104,6 +106,8 @@ jobs:
104106
needs: [container]
105107
container:
106108
image: ${{ needs.container.outputs.container_name }}
109+
permissions:
110+
contents: read
107111
steps:
108112
- name: Checkout
109113
uses: actions/checkout@v4
@@ -122,6 +126,8 @@ jobs:
122126
needs: [container]
123127
container:
124128
image: ${{ needs.container.outputs.container_name }}
129+
permissions:
130+
contents: read
125131
steps:
126132
- name: Checkout
127133
uses: actions/checkout@v4
@@ -133,3 +139,65 @@ jobs:
133139

134140
- name: Build
135141
run: just build
142+
143+
build-docs:
144+
name: Build the documentation
145+
runs-on: ubuntu-latest
146+
needs: [container]
147+
container:
148+
image: ${{ needs.container.outputs.container_name }}
149+
permissions:
150+
contents: read
151+
steps:
152+
- name: Checkout
153+
uses: actions/checkout@v4
154+
with:
155+
submodules: recursive
156+
157+
- name: Set stm32l4r5zi config
158+
run: just config load stm32l4r5zi_def --no-confirm
159+
160+
- name: Generate docs
161+
run: cargo doc --document-private-items --no-deps --workspace
162+
163+
- name: Upload docs artifact
164+
uses: actions/upload-artifact@v4
165+
with:
166+
name: docs
167+
path: target/doc
168+
169+
deploy-docs:
170+
name: Deploy the documentation online
171+
runs-on: ubuntu-latest
172+
needs: [build-docs]
173+
if: github.ref == 'refs/heads/main'
174+
environment:
175+
name: github-pages
176+
url: ${{ steps.deployment.outputs.page_url }}
177+
permissions:
178+
contents: read
179+
pages: write
180+
id-token: write
181+
steps:
182+
- name: Checkout
183+
uses: actions/checkout@v4
184+
with:
185+
sparse-checkout: website
186+
187+
- name: Download docs
188+
uses: actions/download-artifact@v4
189+
with:
190+
name: docs
191+
path: website/docs
192+
193+
- name: Setup Pages
194+
uses: actions/configure-pages@v5
195+
196+
- name: Upload artifact
197+
uses: actions/upload-pages-artifact@v3
198+
with:
199+
path: 'website'
200+
201+
- name: Deploy to GitHub Pages
202+
id: deployment
203+
uses: actions/deploy-pages@v4

website/images/osiris.png

320 KB
Loading

website/index.html

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Osiris RTOS</title>
8+
<style>
9+
* {
10+
margin: 0;
11+
padding: 0;
12+
box-sizing: border-box;
13+
}
14+
15+
body {
16+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
17+
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
18+
min-height: 100vh;
19+
color: white;
20+
}
21+
22+
.container {
23+
display: flex;
24+
flex-direction: column;
25+
align-items: center;
26+
justify-content: center;
27+
min-height: 100vh;
28+
padding: 20px;
29+
}
30+
31+
.header {
32+
text-align: center;
33+
margin-bottom: 2rem;
34+
}
35+
36+
.header h1 {
37+
font-size: 3rem;
38+
margin-bottom: 2rem;
39+
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
40+
}
41+
42+
.header p {
43+
font-size: 1.2rem;
44+
opacity: 0.9;
45+
}
46+
47+
.logo-container {
48+
margin: 2rem 0;
49+
max-width: 500px;
50+
width: 100%;
51+
}
52+
53+
.logo {
54+
width: 100%;
55+
height: auto;
56+
border-radius: 10px;
57+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
58+
}
59+
60+
.nav-links {
61+
display: flex;
62+
gap: 2rem;
63+
margin-top: 2rem;
64+
flex-wrap: wrap;
65+
justify-content: center;
66+
}
67+
68+
.nav-link {
69+
display: inline-flex;
70+
align-items: center;
71+
gap: 0.5rem;
72+
padding: 12px 24px;
73+
background: rgba(255, 255, 255, 0.1);
74+
backdrop-filter: blur(10px);
75+
border: 1px solid rgba(255, 255, 255, 0.2);
76+
border-radius: 50px;
77+
text-decoration: none;
78+
color: white;
79+
font-weight: 500;
80+
transition: all 0.3s ease;
81+
}
82+
83+
.nav-link:hover {
84+
background: rgba(255, 255, 255, 0.2);
85+
transform: translateY(-2px);
86+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
87+
}
88+
89+
.icon {
90+
font-size: 20px;
91+
display: inline-block;
92+
}
93+
94+
footer {
95+
margin-top: 5rem;
96+
text-align: center;
97+
opacity: 0.7;
98+
font-size: 0.9rem;
99+
}
100+
101+
@media (max-width: 768px) {
102+
.header h1 {
103+
font-size: 2rem;
104+
}
105+
106+
.header p {
107+
font-size: 1rem;
108+
}
109+
110+
.nav-links {
111+
flex-direction: column;
112+
align-items: center;
113+
}
114+
115+
.nav-link {
116+
width: 200px;
117+
justify-content: center;
118+
}
119+
}
120+
</style>
121+
</head>
122+
123+
<body>
124+
<div class="container">
125+
<header class="header">
126+
<h1>Osiris RTOS</h1>
127+
<p>A real-time Operating System designed and verified to enable reliable software updates and operation for embedded systems.</p>
128+
</header>
129+
130+
<div class="logo-container">
131+
<img src="images/osiris.png" alt="OsirisRTOS Logo" class="logo">
132+
</div>
133+
134+
<nav class="nav-links">
135+
<a href="https://github.com/OsirisRTOS/osiris/" class="nav-link" target="_blank" rel="noopener">
136+
<span class="icon">💻</span>
137+
Source Code
138+
</a>
139+
140+
<a href="https://osiris.rs/docs/kernel/index.html" class="nav-link" target="_blank" rel="noopener">
141+
<span class="icon">📚</span>
142+
Documentation
143+
</a>
144+
</nav>
145+
146+
<footer>
147+
<p>&copy; 2026 Osiris Authors</p>
148+
</footer>
149+
</div>
150+
</body>
151+
152+
</html>

0 commit comments

Comments
 (0)