-
Notifications
You must be signed in to change notification settings - Fork 24
161 lines (143 loc) · 5.1 KB
/
Copy pathdocs.yml
File metadata and controls
161 lines (143 loc) · 5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Documentation
on:
release:
types: [published]
workflow_dispatch: # manual trigger
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v7
- name: Setup Git User for Applying Patches
# See this thread for more details https://github.qkg1.topmunity/t/github-actions-bot-email-address/17204/5
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y doxygen graphviz
# Build stable documentation
- name: Configure (stable)
run: cmake --preset=ci-ubuntu -Dsleigh_RELEASE_TYPE=stable
- name: Build documentation (stable)
run: cmake --build build --target docs
- name: Copy stable docs
run: |
mkdir -p docs-site/stable
cp -r build/docs/html/* docs-site/stable/
# Clean and build HEAD documentation
- name: Clean build directory
run: rm -rf build
- name: Configure (HEAD)
run: cmake --preset=ci-ubuntu -Dsleigh_RELEASE_TYPE=HEAD
- name: Build documentation (HEAD)
run: cmake --build build --target docs
- name: Copy HEAD docs
run: |
mkdir -p docs-site/HEAD
cp -r build/docs/html/* docs-site/HEAD/
# Create landing page
- name: Create landing page
run: |
cat > docs-site/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sleigh Documentation</title>
<style>
:root {
--bg-color: #f5f5f5;
--text-color: #333;
--text-muted: #666;
--card-bg: white;
--card-shadow: rgba(0,0,0,0.1);
--card-shadow-hover: rgba(0,0,0,0.15);
--link-color: #0066cc;
}
@media (prefers-color-scheme: dark) {
:root {
--bg-color: #1a1a1a;
--text-color: #e0e0e0;
--text-muted: #a0a0a0;
--card-bg: #2d2d2d;
--card-shadow: rgba(0,0,0,0.3);
--card-shadow-hover: rgba(0,0,0,0.4);
--link-color: #4da6ff;
}
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 2rem;
background: var(--bg-color);
color: var(--text-color);
}
h1 {
color: var(--text-color);
}
.cards {
display: flex;
gap: 1rem;
margin-top: 2rem;
}
.card {
flex: 1;
background: var(--card-bg);
border-radius: 8px;
padding: 1.5rem;
text-decoration: none;
color: inherit;
box-shadow: 0 2px 4px var(--card-shadow);
transition: box-shadow 0.2s;
}
.card:hover {
box-shadow: 0 4px 8px var(--card-shadow-hover);
}
.card h2 {
margin-top: 0;
color: var(--link-color);
}
.card p {
color: var(--text-muted);
margin-bottom: 0;
}
</style>
</head>
<body>
<h1>Sleigh Documentation</h1>
<p>Select a documentation version:</p>
<div class="cards">
<a href="stable/" class="card">
<h2>Stable</h2>
<p>Documentation for the latest stable release.</p>
</a>
<a href="HEAD/" class="card">
<h2>HEAD</h2>
<p>Documentation for the latest Ghidra HEAD development version.</p>
</a>
</div>
</body>
</html>
EOF
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: docs-site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5