From 75030611fe87426feadbba04196c481b3f471d86 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Fri, 15 Aug 2025 12:09:27 -0400 Subject: [PATCH] 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. --- .github/workflows/create-docusaurus-pr.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-docusaurus-pr.yml b/.github/workflows/create-docusaurus-pr.yml index 09cd36641..6c11cc0d4 100644 --- a/.github/workflows/create-docusaurus-pr.yml +++ b/.github/workflows/create-docusaurus-pr.yml @@ -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