mirror of
https://github.com/lifting-bits/sleigh
synced 2026-06-21 13:56:12 +00:00
b9c7dcda40
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4 to 5. - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](https://github.com/actions/deploy-pages/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/deploy-pages dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
162 lines
5.1 KiB
YAML
162 lines
5.1 KiB
YAML
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@v6
|
|
|
|
- name: Setup Git User for Applying Patches
|
|
# See this thread for more details https://github.community/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@v4
|
|
with:
|
|
path: docs-site
|
|
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v5
|