Skip to content

Commit 7503061

Browse files
committed
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.
1 parent 216dc75 commit 7503061

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/create-docusaurus-pr.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,24 @@ jobs:
3737
echo "Source directory does not exist!"
3838
exit 1
3939
fi
40+
# Remove old API docs but preserve other folders
4041
rm -rf docs-repo/docs/API/
4142
mkdir -p docs-repo/docs/API
43+
4244
# Copy all markdown files and maintain directory structure
4345
cp -r source-repo/api/docs/public/. docs-repo/docs/API/
4446
45-
# Ensure images directory is properly copied
47+
# Clean and copy images directory specifically
48+
rm -rf docs-repo/docs/API/images/
49+
mkdir -p docs-repo/docs/API/images
50+
51+
# Copy images from public/images if they exist
4652
if [ -d "source-repo/api/docs/public/images" ]; then
47-
mkdir -p docs-repo/docs/API/images
4853
cp -r source-repo/api/docs/public/images/. docs-repo/docs/API/images/
4954
fi
5055
51-
# Also check for images in the parent docs directory
56+
# Also copy any images from the parent docs/images directory
5257
if [ -d "source-repo/api/docs/images" ]; then
53-
mkdir -p docs-repo/docs/API/images
5458
cp -r source-repo/api/docs/images/. docs-repo/docs/API/images/
5559
fi
5660
- name: Create Pull Request

0 commit comments

Comments
 (0)