Skip to content

Commit

Permalink
added dispoAPI doc generation to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
timschaeren committed Sep 26, 2024
1 parent 5e1c296 commit 032340b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/redocly_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Generate html from yml docs and publish to pages
on:
push:
branches:
- main
- main

jobs:
generate_docs:
Expand All @@ -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."
Expand All @@ -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."
Expand All @@ -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:
Expand Down

0 comments on commit 032340b

Please sign in to comment.