feat: add two-volume dev landing pages and fix preview workflow checkout

- Update dev landing to link to /book/ volume chooser instead of old single-volume path
- Add book-index.html as volume picker page deployed at /book/ (Vol I + Vol II cards)
- Fix preview workflow to checkout from dev branch (ref: dev) so landing pages always come from dev
- Add book-index.html to sparse checkout and deploy step
This commit is contained in:
Vijay Janapa Reddi
2026-03-06 20:43:27 -05:00
parent 45db067464
commit 3c6b274ce8
3 changed files with 143 additions and 2 deletions

137
.github/dev-landing/book-index.html vendored Normal file
View File

@@ -0,0 +1,137 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MLSysBook — Choose Volume</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>📚</text></svg>">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #e4e4e4;
padding: 2rem;
}
.container { max-width: 750px; text-align: center; }
.badge {
display: inline-block;
background: #e94560;
color: white;
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.85rem;
font-weight: 600;
margin-bottom: 1.5rem;
text-transform: uppercase;
letter-spacing: 1px;
}
h1 {
font-size: 2.2rem;
margin-bottom: 0.5rem;
background: linear-gradient(90deg, #fff, #e4e4e4);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.subtitle {
color: #a4a4a4;
margin-bottom: 2.5rem;
font-size: 1.05rem;
}
.cards {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
margin-bottom: 2rem;
}
.card {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 16px;
padding: 2rem 1.5rem;
text-decoration: none;
color: inherit;
transition: all 0.3s ease;
}
.card:hover {
transform: translateY(-5px);
background: rgba(255, 255, 255, 0.1);
border-color: rgba(255, 255, 255, 0.2);
}
.card-icon { font-size: 3rem; margin-bottom: 1rem; }
.card h2 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.card .vol-subtitle {
color: #ccc;
font-size: 0.8rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 0.75rem;
}
.card p { color: #a4a4a4; font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.5; }
.card-link { color: #e94560; font-size: 0.9rem; font-weight: 500; }
.footer {
color: #666;
font-size: 0.85rem;
margin-top: 1rem;
}
.footer a { color: #888; text-decoration: none; }
.footer a:hover { color: #e94560; }
@media (max-width: 600px) {
.cards { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<div class="container">
<div class="badge">Development Preview</div>
<h1>Machine Learning Systems</h1>
<p class="subtitle">Select a volume to begin reading</p>
<div class="cards">
<a href="./vol1/" class="card">
<div class="card-icon">📖</div>
<h2>Volume I</h2>
<div class="vol-subtitle">Foundations</div>
<p>Introduction to Machine Learning Systems — single-machine foundations, optimization, and deployment</p>
<span class="card-link">Open Volume I →</span>
</a>
<a href="./vol2/" class="card">
<div class="card-icon">📘</div>
<h2>Volume II</h2>
<div class="vol-subtitle">At Scale</div>
<p>Machine Learning Systems at Scale — distributed training, infrastructure, and production systems</p>
<span class="card-link">Open Volume II →</span>
</a>
</div>
<div class="footer">
<a href="../">← Back to Dev Home</a>
</div>
</div>
</body>
</html>

View File

@@ -153,7 +153,7 @@
<a href="./book/" class="card">
<div class="card-icon">📖</div>
<h2>Textbook</h2>
<p>Machine Learning Systems: Principles and Practices of Engineering Artificially Intelligent Systems</p>
<p>Machine Learning Systems — Two-volume textbook covering foundations through production-scale distributed systems</p>
<span class="card-link">Open Book Preview →</span>
</a>

View File

@@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
commit_sha:
description: 'Optional: Specific commit SHA to deploy. Deploys the latest successful `dev` build if empty.'
description: 'Optional: Specific commit SHA to deploy. Deploys the latest successful `dev` build if empty. IMPORTANT: Select the `dev` branch before running.'
required: false
type: string
workflow_run:
@@ -162,10 +162,12 @@ jobs:
- name: ⬇️ Checkout repository (for scripts)
uses: actions/checkout@v6
with:
ref: dev
path: ./repo-scripts
sparse-checkout: |
${{ vars.BOOK_TOOLS }}/scripts/publish/modify_dev_announcement.py
.github/dev-landing/index.html
.github/dev-landing/book-index.html
sparse-checkout-cone-mode: false
- name: 🔧 Modify announcement for dev preview
@@ -216,6 +218,8 @@ jobs:
echo "📄 Deploying landing page to root..."
# Copy landing page (preserves tinytorch/ if it exists)
cp "${{ github.workspace }}/repo-scripts/.github/dev-landing/index.html" index.html
# Copy book volume chooser page so /book/ doesn't 404
cp "${{ github.workspace }}/repo-scripts/.github/dev-landing/book-index.html" ${{ vars.DEV_BOOK_PATH }}/index.html
touch .nojekyll
echo "🔍 Validating deployment content..."