Skip to content

Commit cd6078b

Browse files
committed
Publish both stable and HEAD docs to GitHub Pages
1 parent fc49d23 commit cd6078b

1 file changed

Lines changed: 90 additions & 3 deletions

File tree

.github/workflows/docs.yml

Lines changed: 90 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,103 @@ jobs:
3737
- name: Install dependencies
3838
run: sudo apt-get update && sudo apt-get install -y doxygen graphviz
3939

40-
- name: Configure
40+
# Build stable documentation
41+
- name: Configure (stable)
4142
run: cmake --preset=ci-ubuntu -Dsleigh_RELEASE_TYPE=stable
4243

43-
- name: Build documentation
44+
- name: Build documentation (stable)
4445
run: cmake --build build --target docs
4546

47+
- name: Copy stable docs
48+
run: |
49+
mkdir -p docs-site/stable
50+
cp -r build/docs/html/* docs-site/stable/
51+
52+
# Clean and build HEAD documentation
53+
- name: Clean build directory
54+
run: rm -rf build
55+
56+
- name: Configure (HEAD)
57+
run: cmake --preset=ci-ubuntu -Dsleigh_RELEASE_TYPE=HEAD
58+
59+
- name: Build documentation (HEAD)
60+
run: cmake --build build --target docs
61+
62+
- name: Copy HEAD docs
63+
run: |
64+
mkdir -p docs-site/HEAD
65+
cp -r build/docs/html/* docs-site/HEAD/
66+
67+
# Create landing page
68+
- name: Create landing page
69+
run: |
70+
cat > docs-site/index.html << 'EOF'
71+
<!DOCTYPE html>
72+
<html lang="en">
73+
<head>
74+
<meta charset="UTF-8">
75+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
76+
<title>Sleigh Documentation</title>
77+
<style>
78+
body {
79+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
80+
max-width: 800px;
81+
margin: 0 auto;
82+
padding: 2rem;
83+
background: #f5f5f5;
84+
}
85+
h1 {
86+
color: #333;
87+
}
88+
.cards {
89+
display: flex;
90+
gap: 1rem;
91+
margin-top: 2rem;
92+
}
93+
.card {
94+
flex: 1;
95+
background: white;
96+
border-radius: 8px;
97+
padding: 1.5rem;
98+
text-decoration: none;
99+
color: inherit;
100+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
101+
transition: box-shadow 0.2s;
102+
}
103+
.card:hover {
104+
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
105+
}
106+
.card h2 {
107+
margin-top: 0;
108+
color: #0066cc;
109+
}
110+
.card p {
111+
color: #666;
112+
margin-bottom: 0;
113+
}
114+
</style>
115+
</head>
116+
<body>
117+
<h1>Sleigh Documentation</h1>
118+
<p>Select a documentation version:</p>
119+
<div class="cards">
120+
<a href="stable/" class="card">
121+
<h2>Stable</h2>
122+
<p>Documentation for the latest stable release.</p>
123+
</a>
124+
<a href="HEAD/" class="card">
125+
<h2>HEAD</h2>
126+
<p>Documentation for the latest Ghidra HEAD development version.</p>
127+
</a>
128+
</div>
129+
</body>
130+
</html>
131+
EOF
132+
46133
- name: Upload Pages artifact
47134
uses: actions/upload-pages-artifact@v3
48135
with:
49-
path: build/docs/html
136+
path: docs-site
50137

51138
- name: Deploy to GitHub Pages
52139
id: deployment

0 commit comments

Comments
 (0)