@@ -3,7 +3,7 @@ name: Generate html from yml docs and publish to pages
3
3
on :
4
4
push :
5
5
branches :
6
- - main
6
+ - main
7
7
8
8
jobs :
9
9
generate_docs :
19
19
20
20
- name : Check for .yml files
21
21
run : |
22
- if ls *.yml 1> /dev/null 2>&1; then
22
+ if ls ./*.yml dispoAPI/ *.yml 1> /dev/null 2>&1; then
23
23
echo "YAML files found."
24
24
else
25
25
echo "No YAML files found. Exiting."
@@ -34,14 +34,18 @@ jobs:
34
34
35
35
- name : Generate HTML files
36
36
run : |
37
- for file in *.yml; do
38
- redocly build-docs -o ${file%.*}.html $file
37
+ for file in ./*.yml dispoAPI/*.yml; do
38
+ if [ -f "$file" ]; then
39
+ dir=$(dirname "$file")
40
+ output_html="${dir}/index.html"
41
+ redocly build-docs -o "$output_html" "$file"
42
+ fi
39
43
done
40
44
41
45
- name : Add noIndex Meta Tag
42
46
run : |
43
- for file in *.html; do
44
- if [[ -f "$file" ] ]; then
47
+ for file in ./*.html dispoAPI/ *.html; do
48
+ if [ -f "$file" ]; then
45
49
echo "Found HTML file: $file"
46
50
if sed -i '/<head>/a <meta name="robots" content="noindex">' "$file"; then
47
51
echo "Added meta tag to $file successfully."
@@ -50,14 +54,13 @@ jobs:
50
54
fi
51
55
fi
52
56
done
53
-
54
57
shell : bash
55
58
56
59
- name : Set up Git
57
60
run : |
58
61
git config --global user.email "[email protected] "
59
62
git config --global user.name "GitHub Actions"
60
-
63
+
61
64
- name : Deploy to GitHub Pages
62
65
63
66
with :
0 commit comments