-
Notifications
You must be signed in to change notification settings - Fork 184
96 lines (90 loc) · 3.3 KB
/
dls-build-documentation.yaml
File metadata and controls
96 lines (90 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: "[DLS] Documentation PR workflow"
run-name: "[DLS] Documentation PR workflow (by @${{ github.actor }} via ${{ github.event_name }})"
on:
push:
branches:
- 'main'
paths:
- 'docs/**'
pull_request:
paths:
- 'docs/**'
permissions: {}
jobs:
build-docs:
name: Build DL Streamer documentation
runs-on: dlstreamer
permissions:
contents: read
steps:
- name: Check out dlstreamer repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #6.0.2
with:
persist-credentials: false
- name: Run build script
run: |
./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='./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='./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 "### Building with Sphinx results" >> $GITHUB_STEP_SUMMARY
echo -e "$summary_content" >> $GITHUB_STEP_SUMMARY
- name: Check specific links
if: always()
run: |
cd ./docs
python3 ./scripts/specific_links_checker.py 2>&1 | tee specific_links_checker_report.txt
summary=$(grep -E '✅ All links are working\.|❌ [0-9]+ broken link\(s\)' specific_links_checker_report.txt | tail -n 1)
echo "### Extra links checker" >> $GITHUB_STEP_SUMMARY
echo "$summary" >> $GITHUB_STEP_SUMMARY
- name: Upload linkcheck report
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f #7.0.0
if: always()
with:
name: docs_linkcheck_report
path: ./docs/build-linkcheck/
- name: Upload specific links checker report
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f #7.0.0
if: always()
with:
name: docs_specific_links_checker_report
path: ./docs/specific_links_checker_report.txt
- name: Upload spelling report
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f #7.0.0
if: always()
with:
name: docs_spelling_report
path: ./docs/build-spelling/
- name: Upload pages
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f #7.0.0
if: always()
with:
name: docs_site
path: ./docs/build-html
- name: Clean up
if: always()
run: rm -rf "$GITHUB_WORKSPACE"/*