1+ name : " [DLS] Documentation PR workflow"
2+ run-name : " [DLS] Documentation PR workflow (by @${{ github.actor }} via ${{ github.event_name }})"
3+ on :
4+ push :
5+ branches :
6+ - ' main'
7+ paths :
8+ - ' libraries/dl-streamer/docs/**'
9+ pull_request :
10+ paths :
11+ - ' libraries/dl-streamer/docs/**'
12+ permissions : read-all
13+
14+ jobs :
15+ build-docs :
16+ name : Build DL Streamer documentation
17+ runs-on : ubuntu-latest # Change to self-hosted when ready to unblock linkcheck: [self-hosted, linux]
18+ steps :
19+ - name : Check out edge-ai-libraries repository/libraries/dl-streamer
20+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
21+ with :
22+ sparse-checkout : |
23+ libraries/dl-streamer
24+
25+ - name : Run build script
26+ run : |
27+ ./libraries/dl-streamer/docs/build_html.sh "actions-gh-pages:latest" gh-pages
28+
29+ - name : Documentation build summary
30+ if : always()
31+ run : |
32+ summary_content=""
33+
34+ # Check if index.html for documentation exists
35+ index_file_path='./libraries/dl-streamer/docs/build-html/index.html'
36+ if [ -f "$index_file_path" ]; then
37+ result="Documentation built: YES :white_check_mark:"
38+ else
39+ result="Documentation built: NO :x:"
40+ fi
41+ echo "$result"
42+ summary_content+="$result\n"
43+
44+ # Check broken links in linkcheck
45+ linkcheck_file_path='./libraries/dl-streamer/docs/build-linkcheck/output.txt'
46+ broken_count=$(grep -o '\[broken\]' "$linkcheck_file_path" | wc -l)
47+ if [ "$broken_count" -eq 0 ]; then
48+ result="Broken links: $broken_count :white_check_mark:"
49+ else
50+ result="Broken links: $broken_count :x:"
51+ fi
52+ echo "$result"
53+ summary_content+="$result\n"
54+
55+ # Spelling
56+ result="Spelling: check report from artifacts"
57+ echo "$result"
58+ summary_content+="$result\n"
59+
60+ echo -e "$summary_content" >> $GITHUB_STEP_SUMMARY
61+
62+ - name : Upload linkcheck report
63+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
64+ if : always()
65+ with :
66+ name : docs_linkcheck_report
67+ path : ./libraries/dl-streamer/docs/build-linkcheck/
68+
69+ - name : Upload spelling report
70+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
71+ if : always()
72+ with :
73+ name : docs_spelling_report
74+ path : ./libraries/dl-streamer/docs/build-spelling/
75+
76+ - name : Upload pages
77+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
78+ if : always()
79+ with :
80+ name : docs_site
81+ path : ./libraries/dl-streamer/docs/build-html
82+
83+ - name : Clean up
84+ if : always()
85+ run : |
86+ rm -rf edge-ai-libraries-repo
0 commit comments