Skip to content

Commit eb7d0ff

Browse files
committed
revert: undo multi-version docs PR #113 (actions not allowed by org policy)
1 parent cfc4fd2 commit eb7d0ff

File tree

4 files changed

+38
-184
lines changed

4 files changed

+38
-184
lines changed

.github/workflows/build_deploy.yml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
name: Build and deploy OpenSPP documentation (previews only)
2-
3-
# NOTE: stable branch is now handled by build_deploy_multiversion.yml
4-
# This workflow only handles preview deployments for other branches
1+
name: Build and deploy OpenSPP documentation
52

63
on:
74
push:
85
branches-ignore:
96
- cf-pages
10-
- stable # stable is handled by multiversion workflow
117

128
jobs:
139
build_deploy:
@@ -36,15 +32,27 @@ jobs:
3632

3733
# Set safe branch name for preview deployments
3834
- name: Set safe branch name
35+
if: github.ref != 'refs/heads/stable'
3936
id: branch
4037
run: |
4138
# Sanitize branch name: only allow alphanumeric, dots, underscores, hyphens
4239
# Replace all other characters with hyphens and limit to 50 characters
4340
SAFE_NAME=$(echo ${GITHUB_REF_NAME} | sed 's/[^a-zA-Z0-9._-]/-/g' | cut -c1-50)
4441
echo "safe=${SAFE_NAME}" >> $GITHUB_OUTPUT
4542
46-
# Build preview documentation
43+
# Build documentation with appropriate environment variables
44+
- name: Prepare deploy (stable)
45+
if: github.ref == 'refs/heads/stable'
46+
run: |
47+
set -e # Exit on error
48+
export DOCS_VERSION=stable
49+
export DOCS_BASEURL=https://docs.openspp.org/
50+
export IS_PREVIEW=0
51+
export DOCS_GITHUB_VERSION=stable
52+
make deploy || { echo "Build failed"; exit 1; }
53+
4754
- name: Prepare deploy (preview)
55+
if: github.ref != 'refs/heads/stable'
4856
run: |
4957
set -e # Exit on error
5058
export DOCS_VERSION=${{ steps.branch.outputs.safe }}
@@ -53,8 +61,19 @@ jobs:
5361
export DOCS_GITHUB_VERSION=${GITHUB_REF_NAME}
5462
make deploy || { echo "Build failed"; exit 1; }
5563
56-
# Deploy preview documentation
64+
# Deploy stable documentation (main branch)
65+
- name: Deploy stable documentation (to cf-pages branch)
66+
if: github.ref == 'refs/heads/stable'
67+
uses: peaceiris/actions-gh-pages@v3
68+
with:
69+
github_token: ${{ secrets.GITHUB_TOKEN }}
70+
publish_dir: _build/html
71+
publish_branch: cf-pages
72+
keep_files: true # Don't delete preview versions
73+
74+
# Deploy preview documentation (non-main branches)
5775
- name: Deploy preview documentation (to cf-pages branch)
76+
if: github.ref != 'refs/heads/stable'
5877
uses: peaceiris/actions-gh-pages@v3
5978
with:
6079
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -65,5 +84,9 @@ jobs:
6584

6685
- name: Display deployment status
6786
run: |
68-
BRANCH_SAFE=$(echo ${GITHUB_REF_NAME} | sed 's/\//-/g')
69-
echo "✅ Deployed preview documentation to https://docs.openspp.org/previews/${BRANCH_SAFE}/"
87+
if [ "${{ github.ref }}" == "refs/heads/stable" ]; then
88+
echo "✅ Deployed stable documentation to https://docs.openspp.org/"
89+
else
90+
BRANCH_SAFE=$(echo ${GITHUB_REF_NAME} | sed 's/\//-/g')
91+
echo "✅ Deployed preview documentation to https://docs.openspp.org/previews/${BRANCH_SAFE}/"
92+
fi

.github/workflows/build_deploy_multiversion.yml

Lines changed: 0 additions & 169 deletions
This file was deleted.

docs/_static/switcher.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[
22
{
3-
"name": "2.0 (latest)",
4-
"version": "2.0",
3+
"name": "stable (latest)",
4+
"version": "stable",
55
"url": "https://docs.openspp.org/"
66
},
77
{
88
"name": "1.3",
99
"version": "1.3",
10-
"url": "https://docs.openspp.org/v1.3/"
10+
"url": "https://docs.openspp.org/1.3/"
1111
}
1212
]

docs/_static/version_switcher.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ document.addEventListener('DOMContentLoaded', function() {
2828
// Get current page path, removing any version prefix
2929
let currentPath = window.location.pathname;
3030

31-
// Remove version prefixes: /previews/branch-name/ or /v1.3/ or /1.3/
31+
// Remove version prefixes: /previews/branch-name/ or /version/
3232
// This regex matches /previews/anything/ at the start
3333
currentPath = currentPath.replace(/^\/previews\/[^\/]+\//, '/');
34-
// This regex matches /v1.3/ or /1.3/ patterns at the start (with optional 'v' prefix)
35-
currentPath = currentPath.replace(/^\/v?[0-9.]+\//, '/');
34+
// This regex matches /version-number/ patterns at the start
35+
currentPath = currentPath.replace(/^\/[0-9.]+\//, '/');
3636
// Remove leading slash since newUrl already has trailing slash
3737
currentPath = currentPath.replace(/^\/+/, '');
3838

0 commit comments

Comments
 (0)