mirror of
https://github.com/unraid/api.git
synced 2026-01-03 23:19:54 -06:00
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:
12
.github/workflows/create-docusaurus-pr.yml
vendored
12
.github/workflows/create-docusaurus-pr.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user