Skip to content

Commit f1460d1

Browse files
jonphippsclaude
andcommitted
fix: improve CI artifact restoration with flexible path detection
- Add debug output to show available artifact structure - Support multiple possible artifact directory layouts - Add fallback logic to handle different upload patterns - Ensure proper directory creation before copying files This should resolve the sitemap validation failures by properly restoring build artifacts to expected locations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 205a6c7 commit f1460d1

File tree

1 file changed

+40
-9
lines changed

1 file changed

+40
-9
lines changed

.github/workflows/test-site-builds.yml

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,21 +206,52 @@ jobs:
206206
- name: Restore build artifacts to proper locations
207207
run: |
208208
echo "=== Restoring artifacts to proper directory structure ==="
209-
# Create directories if they don't exist
209+
# Create base directories
210210
mkdir -p portal standards
211211
212-
# Move portal build if it exists
213-
if [ -d "artifacts/build-portal/portal" ]; then
214-
echo "Moving portal build..."
215-
cp -r artifacts/build-portal/portal/* portal/
212+
# Debug: Show what artifacts we have
213+
echo "=== Available artifacts ==="
214+
ls -la artifacts/ 2>/dev/null || echo "No artifacts directory found"
215+
216+
# Restore portal build - check multiple possible paths
217+
if [ -d "artifacts/build-portal" ]; then
218+
echo "Found portal artifact directory"
219+
# Try different possible structures
220+
if [ -d "artifacts/build-portal/portal" ]; then
221+
echo "Moving portal build from artifacts/build-portal/portal..."
222+
cp -r artifacts/build-portal/portal/* portal/
223+
elif [ -d "artifacts/build-portal/build" ]; then
224+
echo "Moving portal build from artifacts/build-portal/build..."
225+
cp -r artifacts/build-portal/build/* portal/build/
226+
mkdir -p portal/build
227+
else
228+
echo "Portal artifact structure:"
229+
find artifacts/build-portal -type f | head -10
230+
# Try to copy everything from the artifact
231+
cp -r artifacts/build-portal/* portal/
232+
fi
216233
fi
217234
218-
# Move standards builds if they exist
235+
# Restore standards builds - check multiple possible paths
219236
for site in ISBDM LRM FRBR isbd muldicat unimarc; do
220-
if [ -d "artifacts/build-$site/standards/$site" ]; then
221-
echo "Moving $site build..."
237+
if [ -d "artifacts/build-$site" ]; then
238+
echo "Found $site artifact directory"
222239
mkdir -p "standards/$site"
223-
cp -r "artifacts/build-$site/standards/$site"/* "standards/$site/"
240+
241+
# Try different possible structures
242+
if [ -d "artifacts/build-$site/standards/$site" ]; then
243+
echo "Moving $site build from artifacts/build-$site/standards/$site..."
244+
cp -r "artifacts/build-$site/standards/$site"/* "standards/$site/"
245+
elif [ -d "artifacts/build-$site/build" ]; then
246+
echo "Moving $site build from artifacts/build-$site/build..."
247+
mkdir -p "standards/$site/build"
248+
cp -r "artifacts/build-$site/build"/* "standards/$site/build/"
249+
else
250+
echo "$site artifact structure:"
251+
find "artifacts/build-$site" -type f | head -10
252+
# Try to copy everything from the artifact
253+
cp -r "artifacts/build-$site"/* "standards/$site/"
254+
fi
224255
fi
225256
done
226257

0 commit comments

Comments
 (0)