diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index 2738df0..d8f92d8 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -33,7 +33,6 @@ jobs: image: minlag/mermaid-cli:latest options: -v ${{ github.workspace }}:/app -w /app run: | - ls ./scripts chmod +x ./scripts/render-images.sh ./scripts/render-images.sh - name: Upload artifacts diff --git a/scripts/render-images.sh b/scripts/render-images.sh index 193cee6..e147ea0 100755 --- a/scripts/render-images.sh +++ b/scripts/render-images.sh @@ -3,12 +3,16 @@ input_dir="diagrams" output_dir="docs/images" +command_path=$( [ -z "$CI" ] && echo "." || echo "/home/mermaidcli" ) +config_path=$( [ -z "$CI" ] && echo "." || echo "") + echo "Start rendering mermaid diagrams" for file in "$input_dir"/*.mmd; do echo "rendering $file" + base_name=$(basename "$file" .mmd) - ./node_modules/.bin/mmdc -p puppeteer-config.json -i "$file" -o "$output_dir/${base_name}.svg" -b transparent + "$command_path/node_modules/.bin/mmdc" -p "$config_path/puppeteer-config.json" -i "$file" -o "$output_dir/${base_name}.svg" -b transparent done echo "Rendering mermaid diagrams completed."