refactor: improve image handling in Docusaurus PR workflow

- Enhanced the create-docusaurus-pr.yml workflow to cleanly remove old API images and ensure proper copying of images from both the API and parent documentation directories. This update maintains the directory structure and improves the accuracy of the generated documentation.
This commit is contained in:
Eli Bosley
2025-08-15 12:09:27 -04:00
parent 216dc75d66
commit 75030611fe

View File

@@ -37,20 +37,24 @@ jobs:
echo "Source directory does not exist!"
exit 1
fi
# Remove old API docs but preserve other folders
rm -rf docs-repo/docs/API/
mkdir -p docs-repo/docs/API
# Copy all markdown files and maintain directory structure
cp -r source-repo/api/docs/public/. docs-repo/docs/API/
# Ensure images directory is properly copied
# Clean and copy images directory specifically
rm -rf docs-repo/docs/API/images/
mkdir -p docs-repo/docs/API/images
# Copy images from public/images if they exist
if [ -d "source-repo/api/docs/public/images" ]; then
mkdir -p docs-repo/docs/API/images
cp -r source-repo/api/docs/public/images/. docs-repo/docs/API/images/
fi
# Also check for images in the parent docs directory
# Also copy any images from the parent docs/images directory
if [ -d "source-repo/api/docs/images" ]; then
mkdir -p docs-repo/docs/API/images
cp -r source-repo/api/docs/images/. docs-repo/docs/API/images/
fi
- name: Create Pull Request