Skip to content

Generate Docs

Generate Docs #2

Workflow file for this run

name: Generate Docs
on:
workflow_dispatch:
inputs:
reason:
description: 'Reason for running the workflow'
required: false
default: 'Manual trigger'
jobs:
convert-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Convert notebooks to markdown
run: |
for notebook in notebooks/*.ipynb; do
jupyter nbconvert --to markdown "$notebook" --output-dir docs/
done
- name: Update index page
run: |
echo "## Available Documentation:" > docs/index.md
echo "" >> docs/index.md
for file in docs/*.md; do
if [ "$(basename "$file")" != "index.md" ]; then
echo "- [$(basename "$file" .md)]($(basename "$file"))" >> docs/index.md
fi
done
- name: Commit and push changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs
git commit -m "Update documentation (Manual trigger: ${{ github.event.inputs.reason }})" || echo "No changes to commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}