11name : Build and deploy multi-version OpenSPP documentation
22
33# This workflow builds and deploys multi-version documentation:
4- # - v1.3 (stable) from stable branch -> root (/)
5- # - v2.0 from v2-odoo19-doc-refresh branch -> /v2.0 /
4+ # - v2.0 from v2-odoo19-doc-refresh branch -> root (/)
5+ # - v1.3 (stable) from stable branch -> /v1.3 /
66
77on :
88 push :
3232 sudo apt-get install -y graphviz libsasl2-dev libldap2-dev libssl-dev
3333
3434 # ============================================
35- # BUILD v1.3 (from stable branch) -> ROOT
35+ # BUILD v1.3 (from stable branch) -> /v1.3/
3636 # ============================================
3737 - name : Install v1.3 dependencies (stable)
3838 run : |
@@ -47,17 +47,17 @@ 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 (root )
50+ - name : Build v1.3 documentation (/v1.3/ )
5151 run : |
5252 set -e
5353 rm -rf _build/
5454 export DOCS_VERSION=1.3
55- export DOCS_BASEURL=https://docs.openspp.org/
56- sphinx-build -b html docs _build/html
55+ export DOCS_BASEURL=https://docs.openspp.org/v1.3/
56+ sphinx-build -b html docs _build/html/v1.3
5757 echo "v1.3 build complete"
5858
5959 # ============================================
60- # BUILD v2.0 (from v2-odoo19-doc-refresh branch) -> /v2.0/
60+ # BUILD v2.0 (from v2-odoo19-doc-refresh branch) -> ROOT
6161 # ============================================
6262 - name : Checkout v2 docs
6363 run : |
@@ -76,23 +76,24 @@ jobs:
7676 # Install any additional requirements for v2
7777 pip install -q -r requirements_frozen.txt || pip install -q -r requirements.txt
7878
79- - name : Build v2.0 documentation (/v2.0/ )
79+ - name : Build v2.0 documentation (root )
8080 run : |
8181 set -e
8282 rm -rf _build/
8383 export DOCS_VERSION=2.0
84- export DOCS_BASEURL=https://docs.openspp.org/v2.0/
85- sphinx-build -b html docs _build/html/v2.0
84+ export DOCS_BASEURL=https://docs.openspp.org/
85+ sphinx-build -b html docs _build/html
8686 echo "v2.0 build complete"
8787
8888 # ============================================
8989 # COMBINE BUILDS & SETUP VERSION SWITCHER
9090 # ============================================
9191 - name : Combine builds
9292 run : |
93- # Move v1.3 build back as root
94- mv /tmp/v1.3-build/* _build/html/
95- echo "Combined v1.3 (root) and v2.0 (/v2.0/)"
93+ # v1.3 was built to _build/html/v1.3, saved as /tmp/v1.3-build (contains v1.3/ subdir)
94+ # v2.0 is at _build/html (root) — move v1.3 build back under it
95+ mv /tmp/v1.3-build/v1.3 _build/html/v1.3
96+ echo "Combined v2.0 (root) and v1.3 (/v1.3/)"
9697
9798 - name : Setup version switcher
9899 run : |
@@ -102,25 +103,25 @@ jobs:
102103 cat > _build/html/_static/switcher.json << 'EOF'
103104 [
104105 {
105- "name": "1.3 ",
106- "version": "1.3 ",
106+ "name": "2.0 ",
107+ "version": "2.0 ",
107108 "url": "https://docs.openspp.org/"
108109 },
109110 {
110- "name": "2.0 ",
111- "version": "2.0 ",
112- "url": "https://docs.openspp.org/v2.0 /"
111+ "name": "1.3 ",
112+ "version": "1.3 ",
113+ "url": "https://docs.openspp.org/v1.3 /"
113114 }
114115 ]
115116 EOF
116117
117- # Copy to v2.0
118- cp _build/html/_static/switcher.json _build/html/v2.0 /_static/
118+ # Copy to v1.3
119+ cp _build/html/_static/switcher.json _build/html/v1.3 /_static/
119120
120121 # Copy version_switcher.js from stable (saved earlier) to both builds
121122 # This ensures we use the fixed version with proper regex
122123 cp /tmp/version_switcher.js _build/html/_static/
123- cp /tmp/version_switcher.js _build/html/v2.0 /_static/
124+ cp /tmp/version_switcher.js _build/html/v1.3 /_static/
124125
125126 echo "Version switcher configured"
126127
@@ -138,11 +139,11 @@ jobs:
138139 echo "Multi-version documentation build complete"
139140 echo "============================================"
140141 echo ""
141- echo "v1.3 (root):"
142+ echo "v2.0 (root):"
142143 ls -la _build/html/ | head -10
143144 echo ""
144- echo "v2.0 (/v2.0 /):"
145- ls -la _build/html/v2.0 / | head -10
145+ echo "v1.3 (/v1.3 /):"
146+ ls -la _build/html/v1.3 / | head -10
146147 echo ""
147148 echo "Version switcher:"
148149 cat _build/html/_static/switcher.json
@@ -182,7 +183,7 @@ jobs:
182183
183184 # Commit and push
184185 git add -A
185- git commit -m "Deploy multi-version documentation (v1.3 + v2.0 )" || echo "No changes to commit"
186+ git commit -m "Deploy multi-version documentation (v2.0 + v1.3 )" || echo "No changes to commit"
186187 git push origin cf-pages
187188
188189 # Clean up
@@ -195,5 +196,5 @@ jobs:
195196 echo "============================================"
196197 echo ""
197198 echo "URLs:"
198- echo " - v1.3 : https://docs.openspp.org/"
199- echo " - v2.0 : https://docs.openspp.org/v2.0 /"
199+ echo " - v2.0 : https://docs.openspp.org/"
200+ echo " - v1.3 : https://docs.openspp.org/v1.3 /"
0 commit comments