From 032340b9f8060ddf82a7f176f5089f6b938d9a6e Mon Sep 17 00:00:00 2001 From: schaerentim Date: Thu, 26 Sep 2024 10:17:22 +0200 Subject: [PATCH] added dispoAPI doc generation to workflow --- .github/workflows/redocly_and_publish.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/redocly_and_publish.yml b/.github/workflows/redocly_and_publish.yml index 432db83..4445f6f 100644 --- a/.github/workflows/redocly_and_publish.yml +++ b/.github/workflows/redocly_and_publish.yml @@ -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 '//a ' "$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 "actions@github.com" git config --global user.name "GitHub Actions" - + - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@4.1.3 with: