CI - Added Docs Generation Instructions

Signed-off-by: Justin Williams <juwillia@amd.com>


[ROCm/amdsmi commit: af69f75a86]
Этот коммит содержится в:
Justin Williams
2025-07-10 04:21:37 +00:00
коммит произвёл Arif, Maisam
родитель be13c1cf81
Коммит 35b740f736
+22 -40
Просмотреть файл
@@ -8,7 +8,7 @@ on:
workflow_dispatch:
permissions:
contents: write
contents: read
env:
DEBIAN_FRONTEND: noninteractive
@@ -22,10 +22,8 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get branch name and path
- name: Get branch name for artifact naming
id: get_branch_info
run: |
BRANCH_NAME=""
@@ -34,13 +32,11 @@ jobs:
else
BRANCH_NAME="${{ github.ref_name }}"
fi
SANITIZED_PATH=$(echo "$BRANCH_NAME" | sed -e 's|/|-|g' -e 's|[^a-zA-Z0-9._-]||g' | sed -e 's|^-*||' -e 's|-*$||')
if [[ -z "$SANITIZED_PATH" ]]; then
SANITIZED_PATH="docs-$(date +%s)"
SANITIZED_NAME=$(echo "$BRANCH_NAME" | sed -e 's|/|-|g' -e 's|[^a-zA-Z0-9._-]||g' -e 's|^-*||' -e 's|-*$||')
if [[ -z "$SANITIZED_NAME" ]]; then
SANITIZED_NAME="docs-$(date +%s)"
fi
echo "original_branch_name=${BRANCH_NAME}" >> $GITHUB_OUTPUT
echo "deployment_path=${SANITIZED_PATH}" >> $GITHUB_OUTPUT
echo "Deploying docs for branch '${BRANCH_NAME}' to path '${SANITIZED_PATH}'"
echo "sanitized_name=${SANITIZED_NAME}" >> $GITHUB_OUTPUT
- name: Set up Python
uses: actions/setup-python@v4
@@ -59,43 +55,29 @@ jobs:
- name: Build Documentation
run: |
echo "Building documentation..."
echo "Current directory: $(pwd)"
echo "Git repository verification:"
ls -la .git/ || echo "No .git directory found"
git status --porcelain || echo "Git status failed, but continuing..."
if [ ! -e "docs/.git" ]; then
if [ -d ".git" ]; then
ln -s ../.git docs/.git
echo "Created symbolic link to .git in docs directory"
else
echo "Warning: Main .git directory not found. Git-based versioning in docs might not work."
fi
fi
cd docs
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
echo "Documentation build complete."
- name: Verify Build Output
run: |
echo "Verifying build output..."
ls -la docs/_build/html
if [ ! -f "docs/_build/html/index.html" ]; then
echo "Error: index.html not found in the build output directory."
exit 1
fi
echo "Build output verification complete. index.html found."
- name: Create Artifact Directory with Index Only
run: |
echo "Creating artifact directory with only index.html..."
mkdir -p artifact-output
cp docs/_build/html/index.html artifact-output/
echo "Artifact contents:"
ls -la artifact-output/
- name: Upload Documentation Artifact (Index Only)
- name: Upload Documentation
uses: actions/upload-artifact@v4
with:
name: generated-docs-index-${{ steps.get_branch_info.outputs.deployment_path }}
path: artifact-output/
name: documentation-${{ steps.get_branch_info.outputs.sanitized_name }}
path: docs/_build/html/
- name: Generate Job Summary
run: |
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
# 📚 Documentation Generated Successfully!
## 🚀 Quick Start
1. **📥 Download** the artifact `documentation-${{ steps.get_branch_info.outputs.sanitized_name }}`
2. **📂 Extract** the ZIP file
3. **🖱️ Double-click** `index.html`
4. **✅ Done!** Documentation opens with full formatting in your browser
EOF