Skip to content

Commit afde0a3

Browse files
committed
fix: swap versions - stable (v1.3) at root, doc refresh (v2.0) at /v2.0/
- v1.3 (stable) now deployed to root / - v2.0 (preview) now deployed to /v2.0/ - Updated switcher.json with correct URLs
1 parent 5deca22 commit afde0a3

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

.github/workflows/build_deploy_multiversion.yml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Build and deploy multi-version OpenSPP documentation
22

33
# This workflow builds and deploys multi-version documentation:
4-
# - v2.0 (latest) from v2-odoo19-doc-refresh branch root (/)
5-
# - v1.3 from stable branch → /v1.3/
4+
# - v1.3 (stable) from stable branch -> root (/)
5+
# - v2.0 from v2-odoo19-doc-refresh branch -> /v2.0/
66

77
on:
88
push:
@@ -32,7 +32,7 @@ jobs:
3232
sudo apt-get install -y graphviz libsasl2-dev libldap2-dev libssl-dev
3333
3434
# ============================================
35-
# BUILD v1.3 (from stable branch)
35+
# BUILD v1.3 (from stable branch) -> ROOT
3636
# ============================================
3737
- name: Install v1.3 dependencies (stable)
3838
run: |
@@ -47,22 +47,22 @@ jobs:
4747
# Save version_switcher.js for later (before switching branches)
4848
cp docs/_static/version_switcher.js /tmp/version_switcher.js
4949
50-
- name: Build v1.3 documentation
50+
- name: Build v1.3 documentation (root)
5151
run: |
5252
set -e
5353
rm -rf _build/
5454
export DOCS_VERSION=1.3
55-
export DOCS_BASEURL=https://docs.openspp.org/v1.3/
56-
sphinx-build -b html docs _build/html/v1.3
57-
echo "v1.3 build complete"
55+
export DOCS_BASEURL=https://docs.openspp.org/
56+
sphinx-build -b html docs _build/html
57+
echo "v1.3 build complete"
5858
5959
# ============================================
60-
# BUILD v2.0 (from v2-odoo19-doc-refresh branch)
60+
# BUILD v2.0 (from v2-odoo19-doc-refresh branch) -> /v2.0/
6161
# ============================================
6262
- name: Checkout v2 docs
6363
run: |
6464
# Save v1.3 build
65-
mv _build/html/v1.3 /tmp/v1.3-build
65+
mv _build/html /tmp/v1.3-build
6666
6767
# Checkout v2 branch
6868
git checkout v2-odoo19-doc-refresh
@@ -73,23 +73,23 @@ jobs:
7373
# Install any additional requirements for v2
7474
pip install -q -r requirements_frozen.txt || pip install -q -r requirements.txt
7575
76-
- name: Build v2.0 documentation (root)
76+
- name: Build v2.0 documentation (/v2.0/)
7777
run: |
7878
set -e
7979
rm -rf _build/
8080
export DOCS_VERSION=2.0
81-
export DOCS_BASEURL=https://docs.openspp.org/
82-
sphinx-build -b html docs _build/html
83-
echo "v2.0 build complete"
81+
export DOCS_BASEURL=https://docs.openspp.org/v2.0/
82+
sphinx-build -b html docs _build/html/v2.0
83+
echo "v2.0 build complete"
8484
8585
# ============================================
8686
# COMBINE BUILDS & SETUP VERSION SWITCHER
8787
# ============================================
8888
- name: Combine builds
8989
run: |
90-
# Move v1.3 build back
91-
mv /tmp/v1.3-build _build/html/v1.3
92-
echo "Combined v2.0 (root) and v1.3 (/v1.3/)"
90+
# Move v1.3 build back as root
91+
mv /tmp/v1.3-build/* _build/html/
92+
echo "Combined v1.3 (root) and v2.0 (/v2.0/)"
9393
9494
- name: Setup version switcher
9595
run: |
@@ -99,47 +99,47 @@ jobs:
9999
cat > _build/html/_static/switcher.json << 'EOF'
100100
[
101101
{
102-
"name": "2.0 (latest)",
103-
"version": "2.0",
102+
"name": "1.3 (stable)",
103+
"version": "1.3",
104104
"url": "https://docs.openspp.org/"
105105
},
106106
{
107-
"name": "1.3",
108-
"version": "1.3",
109-
"url": "https://docs.openspp.org/v1.3/"
107+
"name": "2.0 (preview)",
108+
"version": "2.0",
109+
"url": "https://docs.openspp.org/v2.0/"
110110
}
111111
]
112112
EOF
113113
114-
# Copy to v1.3
115-
cp _build/html/_static/switcher.json _build/html/v1.3/_static/
114+
# Copy to v2.0
115+
cp _build/html/_static/switcher.json _build/html/v2.0/_static/
116116
117117
# Copy version_switcher.js from stable (saved earlier) to both builds
118118
# This ensures we use the fixed version with proper regex
119119
cp /tmp/version_switcher.js _build/html/_static/
120-
cp /tmp/version_switcher.js _build/html/v1.3/_static/
120+
cp /tmp/version_switcher.js _build/html/v2.0/_static/
121121
122-
echo "Version switcher configured"
122+
echo "Version switcher configured"
123123
124124
- name: Inject version switcher script
125125
run: |
126126
# Inject script tag into all HTML files that don't already have it
127127
find _build/html -name "*.html" -exec grep -L "version_switcher.js" {} \; | \
128128
xargs -I {} sed -i 's|</body>|<script src="/_static/version_switcher.js"></script></body>|g' {}
129129
130-
echo "Version switcher script injected"
130+
echo "Version switcher script injected"
131131
132132
- name: Display build summary
133133
run: |
134134
echo "============================================"
135135
echo "Multi-version documentation build complete"
136136
echo "============================================"
137137
echo ""
138-
echo "v2.0 (root):"
138+
echo "v1.3 (root):"
139139
ls -la _build/html/ | head -10
140140
echo ""
141-
echo "v1.3 (/v1.3/):"
142-
ls -la _build/html/v1.3/ | head -10
141+
echo "v2.0 (/v2.0/):"
142+
ls -la _build/html/v2.0/ | head -10
143143
echo ""
144144
echo "Version switcher:"
145145
cat _build/html/_static/switcher.json
@@ -179,7 +179,7 @@ jobs:
179179
180180
# Commit and push
181181
git add -A
182-
git commit -m "Deploy multi-version documentation (v2.0 + v1.3)" || echo "No changes to commit"
182+
git commit -m "Deploy multi-version documentation (v1.3 + v2.0)" || echo "No changes to commit"
183183
git push origin cf-pages
184184
185185
# Clean up
@@ -192,5 +192,5 @@ jobs:
192192
echo "============================================"
193193
echo ""
194194
echo "URLs:"
195-
echo " - v2.0 (latest): https://docs.openspp.org/"
196-
echo " - v1.3: https://docs.openspp.org/v1.3/"
195+
echo " - v1.3 (stable): https://docs.openspp.org/"
196+
echo " - v2.0 (preview): https://docs.openspp.org/v2.0/"

docs/_static/switcher.json

Lines changed: 5 additions & 5 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": "1.3 (stable)",
4+
"version": "1.3",
55
"url": "https://docs.openspp.org/"
66
},
77
{
8-
"name": "1.3",
9-
"version": "1.3",
10-
"url": "https://docs.openspp.org/v1.3/"
8+
"name": "2.0 (preview)",
9+
"version": "2.0",
10+
"url": "https://docs.openspp.org/v2.0/"
1111
}
1212
]

0 commit comments

Comments
 (0)