Skip to content

Commit 08fa289

Browse files
committed
ci: deploy slides to gh-pages on push to main; serve helper
- pages.yml renders the 2026-Q2 deck with mdslides, stages a gruvbox landing page that links into each event, and ships it via actions/deploy-pages so every push to main republishes the site (Pages source must be set to "GitHub Actions" in repo settings once) - build-slides.sh learns --serve [port]: actually starts python3 -m http.server on the first free port and prints the URL, removing the "you have to copy this command yourself" footgun that broke the local preview - restore the per-event .gitignore rules that got lost in the move so target/, gpui-component/, and slides/ don't show up untracked Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
1 parent ed621d2 commit 08fa289

3 files changed

Lines changed: 146 additions & 3 deletions

File tree

.github/workflows/pages.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Deploy slides to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
# Avoid clobbering an in-flight deploy with a newer push; let it finish.
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install mdslides
25+
# Pin the version so the deck doesn't drift on us between meetups.
26+
run: cargo install --locked --git https://github.com/ferrous-systems/mdslides --tag v0.7.2
27+
28+
- name: Render 2026-Q2 slides
29+
working-directory: 2026-Q2/workshop
30+
run: ./build-slides.sh
31+
32+
- name: Stage site
33+
run: |
34+
set -euo pipefail
35+
mkdir -p _site/2026-Q2
36+
cp -R 2026-Q2/workshop/slides/. _site/2026-Q2/
37+
cat > _site/index.html <<'HTML'
38+
<!doctype html>
39+
<html lang="en">
40+
<head>
41+
<meta charset="utf-8">
42+
<meta name="viewport" content="width=device-width, initial-scale=1">
43+
<title>Rust Munich — Hacking</title>
44+
<link rel="preconnect" href="https://fonts.googleapis.com">
45+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
46+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;700&display=swap" rel="stylesheet">
47+
<style>
48+
:root {
49+
--bg: #1d2021; --bg1: #3c3836; --fg: #ebdbb2; --fg2: #d5c4a1;
50+
--gray: #928374; --orange: #fe8019; --yellow: #fabd2f; --aqua: #8ec07c; --blue: #83a598;
51+
}
52+
* { box-sizing: border-box; }
53+
body {
54+
margin: 0; background: var(--bg); color: var(--fg);
55+
font: 16px/1.5 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
56+
min-height: 100vh; display: flex; justify-content: center;
57+
padding: 4rem 1.5rem;
58+
}
59+
main { max-width: 640px; width: 100%; }
60+
.crumb { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--gray); margin-bottom: 2.5rem; }
61+
.crumb .accent { color: var(--orange); }
62+
h1 { font-size: 2.6rem; line-height: 1.1; margin: 0 0 0.3em; color: var(--orange); font-weight: 700; letter-spacing: -0.02em; }
63+
h1::after { content: ''; display: block; width: 4rem; height: 4px; background: var(--yellow); margin-top: 0.4em; border-radius: 2px; }
64+
.tagline { color: var(--fg2); margin-bottom: 3rem; }
65+
h2 { color: var(--yellow); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 3rem 0 1rem; font-weight: 600; }
66+
ul { list-style: none; padding: 0; margin: 0; }
67+
li a {
68+
display: flex; align-items: baseline; gap: 0.6em;
69+
color: var(--fg); text-decoration: none; font-size: 1.05rem;
70+
padding: 0.7em 0; border-bottom: 1px solid var(--bg1);
71+
transition: color 120ms ease;
72+
}
73+
li a::before { content: '→'; color: var(--aqua); font-family: 'JetBrains Mono', monospace; font-weight: 700; }
74+
li a:hover, li a:hover::before { color: var(--orange); }
75+
footer { margin-top: 4rem; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--gray); border-top: 1px solid var(--bg1); padding-top: 1.5rem; }
76+
footer a { color: var(--blue); text-decoration: none; }
77+
footer a:hover { color: var(--orange); }
78+
</style>
79+
</head>
80+
<body>
81+
<main>
82+
<div class="crumb"><span class="accent">~/</span>rust-munich<span class="accent"> ·</span> hacking evenings</div>
83+
<h1>Rust Munich — Hacking</h1>
84+
<p class="tagline">Slide decks and code from our quarterly hacking evenings.</p>
85+
<h2>Events</h2>
86+
<ul>
87+
<li><a href="2026-Q2/">2026 / Q2 — Crux + gpui</a></li>
88+
</ul>
89+
<footer>
90+
<a href="https://github.com/sassman/rust-munich-hacking">source on GitHub</a>
91+
</footer>
92+
</main>
93+
</body>
94+
</html>
95+
HTML
96+
97+
- uses: actions/upload-pages-artifact@v3
98+
with:
99+
path: _site
100+
101+
deploy:
102+
needs: build
103+
runs-on: ubuntu-latest
104+
environment:
105+
name: github-pages
106+
url: ${{ steps.deployment.outputs.page_url }}
107+
steps:
108+
- id: deployment
109+
uses: actions/deploy-pages@v4

2026-Q2/.gitignore

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
.DS_Store
2-
book/
2+
3+
# Cargo build output
4+
/target/
5+
**/*.rs.bk
6+
Cargo.lock.bak
7+
8+
/docs/superpowers/
9+
/book/
10+
11+
# Local clone of the longbridge widget kit — referenced from the slides,
12+
# not part of the workshop repo itself
13+
/gpui-component/
14+
15+
# mdslides render output — regenerated by ./workshop/build-slides.sh
16+
/workshop/slides/
17+
/workshop/book/

2026-Q2/workshop/build-slides.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env bash
22
# Render the workshop mdbook into a reveal.js slide deck via mdslides.
3-
# Output ends up in ./slides — open ./slides/index.html in a browser.
3+
# Usage:
4+
# ./build-slides.sh # just build into ./slides/
5+
# ./build-slides.sh --serve # build, then serve on the first free port
6+
# ./build-slides.sh -s 8080 # build, then serve on a specific port
47
set -euo pipefail
58

69
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -17,4 +20,20 @@ mdslides \
1720

1821
echo
1922
echo "Slides built → ${OUT}/index.html"
20-
echo "Preview: (cd ${OUT} && python3 -m http.server 8000)"
23+
24+
case "${1:-}" in
25+
-s|--serve)
26+
PORT="${2:-}"
27+
if [[ -z "${PORT}" ]]; then
28+
# Pick the first free port starting from 8000.
29+
for p in 8000 8080 8765 9000; do
30+
if ! lsof -nP -i4TCP:"${p}" >/dev/null 2>&1; then PORT="${p}"; break; fi
31+
done
32+
fi
33+
echo "Serving on http://localhost:${PORT}/ (Ctrl-C to stop)"
34+
cd "${OUT}" && exec python3 -m http.server "${PORT}"
35+
;;
36+
*)
37+
echo "Preview: ./build-slides.sh --serve"
38+
;;
39+
esac

0 commit comments

Comments
 (0)