Skip to content

Commit b94a4b1

Browse files
docs: import existing versions
1 parent d01416c commit b94a4b1

File tree

2 files changed

+65
-5
lines changed

2 files changed

+65
-5
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,37 @@ jobs:
162162
163163
echo "✅ Configuration patches applied"
164164
165+
- name: Import existing versioning artifacts
166+
run: |
167+
echo "📥 Importing existing versioning artifacts from repository..."
168+
cd "${{ env.TEMP_DIR }}/llama-stack/docs"
169+
170+
# Copy existing versioned_docs if they exist
171+
if [ -d "${{ github.workspace }}/versioned_docs" ]; then
172+
cp -r "${{ github.workspace }}/versioned_docs" ./
173+
echo "✅ Imported existing versioned_docs"
174+
else
175+
echo "ℹ️ No existing versioned_docs found (first version)"
176+
fi
177+
178+
# Copy existing versioned_sidebars if they exist
179+
if [ -d "${{ github.workspace }}/versioned_sidebars" ]; then
180+
cp -r "${{ github.workspace }}/versioned_sidebars" ./
181+
echo "✅ Imported existing versioned_sidebars"
182+
else
183+
echo "ℹ️ No existing versioned_sidebars found (first version)"
184+
fi
185+
186+
# Copy existing versions.json if it exists (overrides what we loaded earlier)
187+
if [ -f "${{ github.workspace }}/versions.json" ]; then
188+
cp "${{ github.workspace }}/versions.json" ./
189+
echo "✅ Imported existing versions.json"
190+
else
191+
echo "ℹ️ No existing versions.json found (first version)"
192+
fi
193+
194+
echo "✅ Versioning artifacts import completed"
195+
165196
- name: Build documentation
166197
run: |
167198
cd "${{ env.TEMP_DIR }}/llama-stack/docs"

local-build-test.sh

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,36 @@ EOF
143143

144144
echo "✅ 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
147176
echo "🏗️ Building Docusaurus documentation..."
148177

149178
# Generate API docs first (required for current build)
@@ -191,7 +220,7 @@ touch "$DOCS_DIR/.nojekyll"
191220

192221
echo "✅ 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)
195224
if [ "$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"
212241
fi
213242

214-
# Step 7: Setup versioning files in deployed site
243+
# Step 8: Setup versioning files in deployed site
215244
echo "⚙️ Setting up versioning configuration files..."
216245

217246
# Copy versioning files to deployment
@@ -220,7 +249,7 @@ cp versions.json "$DOCS_DIR/"
220249

221250
echo "✅ Versioning files created"
222251

223-
# Step 8: Verify deployment structure
252+
# Step 9: Verify deployment structure
224253
echo "🔍 Verifying deployment structure..."
225254

226255
echo "Contents of docs directory:"
@@ -235,7 +264,7 @@ echo -e "\nVersioning files:"
235264

236265
echo -e "\n✅ Structure verification complete"
237266

238-
# Step 9: Start local server for testing
267+
# Step 10: Start local server for testing
239268
echo "🌐 Starting local development server..."
240269
echo "📍 Your documentation is available at: http://localhost:3000"
241270
echo "🔗 Main docs: http://localhost:3000/docs.html"

0 commit comments

Comments
 (0)