CI - Added Docs Generation Instructions
Signed-off-by: Justin Williams <juwillia@amd.com>
[ROCm/amdsmi commit: af69f75a86]
This commit is contained in:
committed by
Arif, Maisam
parent
be13c1cf81
commit
35b740f736
+22
-40
@@ -8,7 +8,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
@@ -22,10 +22,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
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
|
id: get_branch_info
|
||||||
run: |
|
run: |
|
||||||
BRANCH_NAME=""
|
BRANCH_NAME=""
|
||||||
@@ -34,13 +32,11 @@ jobs:
|
|||||||
else
|
else
|
||||||
BRANCH_NAME="${{ github.ref_name }}"
|
BRANCH_NAME="${{ github.ref_name }}"
|
||||||
fi
|
fi
|
||||||
SANITIZED_PATH=$(echo "$BRANCH_NAME" | sed -e 's|/|-|g' -e 's|[^a-zA-Z0-9._-]||g' | sed -e 's|^-*||' -e 's|-*$||')
|
SANITIZED_NAME=$(echo "$BRANCH_NAME" | sed -e 's|/|-|g' -e 's|[^a-zA-Z0-9._-]||g' -e 's|^-*||' -e 's|-*$||')
|
||||||
if [[ -z "$SANITIZED_PATH" ]]; then
|
if [[ -z "$SANITIZED_NAME" ]]; then
|
||||||
SANITIZED_PATH="docs-$(date +%s)"
|
SANITIZED_NAME="docs-$(date +%s)"
|
||||||
fi
|
fi
|
||||||
echo "original_branch_name=${BRANCH_NAME}" >> $GITHUB_OUTPUT
|
echo "sanitized_name=${SANITIZED_NAME}" >> $GITHUB_OUTPUT
|
||||||
echo "deployment_path=${SANITIZED_PATH}" >> $GITHUB_OUTPUT
|
|
||||||
echo "Deploying docs for branch '${BRANCH_NAME}' to path '${SANITIZED_PATH}'"
|
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
@@ -59,43 +55,29 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Documentation
|
- name: Build Documentation
|
||||||
run: |
|
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 [ ! -e "docs/.git" ]; then
|
||||||
if [ -d ".git" ]; then
|
if [ -d ".git" ]; then
|
||||||
ln -s ../.git docs/.git
|
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
|
||||||
fi
|
fi
|
||||||
cd docs
|
cd docs
|
||||||
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
|
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
|
||||||
echo "Documentation build complete."
|
|
||||||
|
|
||||||
- name: Verify Build Output
|
- name: Upload Documentation
|
||||||
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)
|
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: generated-docs-index-${{ steps.get_branch_info.outputs.deployment_path }}
|
name: documentation-${{ steps.get_branch_info.outputs.sanitized_name }}
|
||||||
path: artifact-output/
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user