-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added dispoAPI doc generation to workflow
- Loading branch information
1 parent
5e1c296
commit 032340b
Showing
1 changed file
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Generate html from yml docs and publish to pages | |
on: | ||
push: | ||
branches: | ||
- main | ||
- main | ||
|
||
jobs: | ||
generate_docs: | ||
|
@@ -19,7 +19,7 @@ jobs: | |
|
||
- name: Check for .yml files | ||
run: | | ||
if ls *.yml 1> /dev/null 2>&1; then | ||
if ls ./*.yml dispoAPI/*.yml 1> /dev/null 2>&1; then | ||
echo "YAML files found." | ||
else | ||
echo "No YAML files found. Exiting." | ||
|
@@ -34,14 +34,18 @@ jobs: | |
|
||
- name: Generate HTML files | ||
run: | | ||
for file in *.yml; do | ||
redocly build-docs -o ${file%.*}.html $file | ||
for file in ./*.yml dispoAPI/*.yml; do | ||
if [ -f "$file" ]; then | ||
dir=$(dirname "$file") | ||
output_html="${dir}/index.html" | ||
redocly build-docs -o "$output_html" "$file" | ||
fi | ||
done | ||
- name: Add noIndex Meta Tag | ||
run: | | ||
for file in *.html; do | ||
if [[ -f "$file" ]]; then | ||
for file in ./*.html dispoAPI/*.html; do | ||
if [ -f "$file" ]; then | ||
echo "Found HTML file: $file" | ||
if sed -i '/<head>/a <meta name="robots" content="noindex">' "$file"; then | ||
echo "Added meta tag to $file successfully." | ||
|
@@ -50,14 +54,13 @@ jobs: | |
fi | ||
fi | ||
done | ||
shell: bash | ||
|
||
- name: Set up Git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
- name: Deploy to GitHub Pages | ||
uses: JamesIves/[email protected] | ||
with: | ||
|