143143
144144echo " ✅ Configuration patches applied"
145145
146- # Step 4: Build Docusaurus documentation
146+ # Step 4: Import existing versioning artifacts from repository
147+ echo " 📥 Importing existing versioning artifacts from repository..."
148+
149+ # Copy existing versioned_docs if they exist
150+ if [ -d " $WORKSPACE_DIR /versioned_docs" ]; then
151+ cp -r " $WORKSPACE_DIR /versioned_docs" ./
152+ echo " ✅ Imported existing versioned_docs"
153+ else
154+ echo " ℹ️ No existing versioned_docs found (first version)"
155+ fi
156+
157+ # Copy existing versioned_sidebars if they exist
158+ if [ -d " $WORKSPACE_DIR /versioned_sidebars" ]; then
159+ cp -r " $WORKSPACE_DIR /versioned_sidebars" ./
160+ echo " ✅ Imported existing versioned_sidebars"
161+ else
162+ echo " ℹ️ No existing versioned_sidebars found (first version)"
163+ fi
164+
165+ # Copy existing versions.json if it exists (overrides what we loaded earlier)
166+ if [ -f " $WORKSPACE_DIR /versions.json" ]; then
167+ cp " $WORKSPACE_DIR /versions.json" ./
168+ echo " ✅ Imported existing versions.json"
169+ else
170+ echo " ℹ️ No existing versions.json found (first version)"
171+ fi
172+
173+ echo " ✅ Versioning artifacts import completed"
174+
175+ # Step 5: Build Docusaurus documentation
147176echo " 🏗️ Building Docusaurus documentation..."
148177
149178# Generate API docs first (required for current build)
@@ -191,7 +220,7 @@ touch "$DOCS_DIR/.nojekyll"
191220
192221echo " ✅ Docusaurus content deployed"
193222
194- # Step 6 : Update workspace artifacts (if we created a new version)
223+ # Step 7 : Update workspace artifacts (if we created a new version)
195224if [ " $BUILDING_LATEST " != " true" ]; then
196225 echo " 📋 Updating workspace versioning artifacts..."
197226
@@ -211,7 +240,7 @@ if [ "$BUILDING_LATEST" != "true" ]; then
211240 echo " ✅ Updated workspace versions.json"
212241fi
213242
214- # Step 7 : Setup versioning files in deployed site
243+ # Step 8 : Setup versioning files in deployed site
215244echo " ⚙️ Setting up versioning configuration files..."
216245
217246# Copy versioning files to deployment
@@ -220,7 +249,7 @@ cp versions.json "$DOCS_DIR/"
220249
221250echo " ✅ Versioning files created"
222251
223- # Step 8 : Verify deployment structure
252+ # Step 9 : Verify deployment structure
224253echo " 🔍 Verifying deployment structure..."
225254
226255echo " Contents of docs directory:"
@@ -235,7 +264,7 @@ echo -e "\nVersioning files:"
235264
236265echo -e " \n✅ Structure verification complete"
237266
238- # Step 9 : Start local server for testing
267+ # Step 10 : Start local server for testing
239268echo " 🌐 Starting local development server..."
240269echo " 📍 Your documentation is available at: http://localhost:3000"
241270echo " 🔗 Main docs: http://localhost:3000/docs.html"
0 commit comments