Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Deploy Docusaurus Documentation

on:
repository_dispatch:
types: [docs-update]
types: [docs-update, docs-version-deploy]
workflow_dispatch:
inputs:
version:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
git fetch --all --tags

# Determine version to checkout
VERSION="${{ github.event.inputs.version || 'latest' }}"
VERSION="${{ github.event.client_payload.version || github.event.inputs.version || 'latest' }}"
if [ "$VERSION" = "latest" ] || [ -z "$VERSION" ]; then
LSBRANCH="${{ github.event.inputs.ogx_branch || 'main' }}"
LSBRANCH="${LSBRANCH:-main}"
Expand Down Expand Up @@ -358,6 +358,32 @@ jobs:
echo "ℹ️ No changes to commit"
fi

- name: Update versionsArchived.json
if: env.BUILDING_LATEST != 'true'
run: |
cd "${{ github.workspace }}"

TAG="${{ env.VERSION_TAG }}"
python3 -c "
import json
with open('versionsArchived.json') as f:
archived = json.load(f)
tag = '${TAG}'
url = 'https://ogx-ai.github.io/${TAG}/'
if tag not in archived:
archived[tag] = url
def version_key(item):
parts = item[0].lstrip('v').split('.')
return [int(p) for p in parts if p.isdigit()]
archived = dict(sorted(archived.items(), key=version_key, reverse=True))
with open('versionsArchived.json', 'w') as f:
json.dump(archived, f, indent=2)
f.write('\n')
"
git add versionsArchived.json
git diff --staged --quiet || git commit -s -m "docs: add ${TAG} to versionsArchived.json"
git push

- name: Setup GitHub Pages
if: ${{ github.event.inputs.action == 'build-and-deploy' || github.event_name == 'repository_dispatch' }}
uses: actions/configure-pages@v5
Expand Down
54 changes: 5 additions & 49 deletions versions.html
Original file line number Diff line number Diff line change
@@ -1,56 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ogx Documentation Versions</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 800px; margin: 60px auto; padding: 0 24px; color: #1c1e21; }
h1 { font-size: 2rem; margin-bottom: 8px; }
p { color: #606770; margin-bottom: 32px; }
.current { background: #f0f4ff; border: 1px solid #c7d2fe; border-radius: 8px; padding: 16px 20px; margin-bottom: 32px; }
.current a { font-size: 1.1rem; font-weight: 600; color: #4f46e5; text-decoration: none; }
.current a:hover { text-decoration: underline; }
.current .label { font-size: 0.75rem; font-weight: 600; color: #4f46e5; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
h2 { font-size: 1.1rem; color: #606770; margin-bottom: 12px; }
ul { list-style: none; padding: 0; margin: 0; }
li { padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
li:last-child { border-bottom: none; }
li a { color: #1c1e21; text-decoration: none; font-size: 0.95rem; }
li a:hover { color: #4f46e5; }
.back { margin-top: 32px; }
.back a { color: #4f46e5; text-decoration: none; font-size: 0.9rem; }
.back a:hover { text-decoration: underline; }
</style>
<meta http-equiv="refresh" content="0; url=/versions">
<link rel="canonical" href="/versions">
<title>Redirecting...</title>
</head>
<body>
<h1>ogx Docs</h1>
<p>All versions of the ogx documentation.</p>

<div class="current">
<div class="label">Latest</div>
<a href="/">Current documentation</a>
</div>

<h2>Previous versions</h2>
<ul>
<li><a href="https://ogx-ai.github.io/v0.3.0/">v0.3.0</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.22/">v0.2.22</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.21/">v0.2.21</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.20/">v0.2.20</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.19/">v0.2.19</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.18/">v0.2.18</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.17/">v0.2.17</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.16/">v0.2.16</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.15/">v0.2.15</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.14/">v0.2.14</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.13/">v0.2.13</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.12/">v0.2.12</a></li>
<li><a href="https://ogx-ai.github.io/v0.2.11/">v0.2.11</a></li>
</ul>

<div class="back">
<a href="/">← Back to docs</a>
</div>
<p>Redirecting to <a href="/versions">/versions</a>...</p>
</body>
</html>
Loading