Skip to content

[DLS] Documentation PR workflow (by @saikiransayabugari via push) #3

[DLS] Documentation PR workflow (by @saikiransayabugari via push)

[DLS] Documentation PR workflow (by @saikiransayabugari via push) #3

name: "[DLS] Documentation PR workflow"
run-name: "[DLS] Documentation PR workflow (by @${{ github.actor }} via ${{ github.event_name }})"
on:
push:
branches:
- 'main'
paths:
- 'libraries/dl-streamer/docs/**'
pull_request:
paths:
- 'libraries/dl-streamer/docs/**'
permissions: read-all
jobs:
build-docs:
name: Build DL Streamer documentation
runs-on: ubuntu-latest # Change to self-hosted when ready to unblock linkcheck: [self-hosted, linux]
steps:
- name: Check out edge-ai-libraries repository/libraries/dl-streamer
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
with:
sparse-checkout: |
libraries/dl-streamer
- name: Run build script
run: |
./libraries/dl-streamer/docs/build_html.sh "actions-gh-pages:latest" gh-pages
- name: Documentation build summary
if: always()
run: |
summary_content=""
# Check if index.html for documentation exists
index_file_path='./libraries/dl-streamer/docs/build-html/index.html'
if [ -f "$index_file_path" ]; then
result="Documentation built: YES :white_check_mark:"
else
result="Documentation built: NO :x:"
fi
echo "$result"
summary_content+="$result\n"
# Check broken links in linkcheck
linkcheck_file_path='./libraries/dl-streamer/docs/build-linkcheck/output.txt'
broken_count=$(grep -o '\[broken\]' "$linkcheck_file_path" | wc -l)
if [ "$broken_count" -eq 0 ]; then
result="Broken links: $broken_count :white_check_mark:"
else
result="Broken links: $broken_count :x:"
fi
echo "$result"
summary_content+="$result\n"
# Spelling
result="Spelling: check report from artifacts"
echo "$result"
summary_content+="$result\n"
echo -e "$summary_content" >> $GITHUB_STEP_SUMMARY
- name: Upload linkcheck report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #4.6.2
if: always()
with:
name: docs_linkcheck_report
path: ./libraries/dl-streamer/docs/build-linkcheck/
- name: Upload spelling report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #4.6.2
if: always()
with:
name: docs_spelling_report
path: ./libraries/dl-streamer/docs/build-spelling/
- name: Upload pages
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #4.6.2
if: always()
with:
name: docs_site
path: ./libraries/dl-streamer/docs/build-html
- name: Clean up
if: always()
run: |
rm -rf edge-ai-libraries-repo