Update Wiki Documentation #2
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
name: Update Wiki Documentation | |
on: | |
push: | |
paths: | |
- "schemas/redux-config.schema.json" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
generate-docs: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
# Step 2: Set up Python and install jsonschema2md | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install jsonschema2md | |
run: pip install jsonschema2md | |
# Step 3: Generate Markdown documentation | |
- name: Generate Markdown | |
run: | | |
mkdir -p docs | |
jsonschema2md schemas/redux-config.schema.json docs/schema.md | |
# Step 4: Clone the GitHub Wiki repository | |
- name: Clone Wiki Repository | |
run: | | |
git clone https://github.com/${{ github.repository }}.wiki.git wiki | |
mv docs/schema.md wiki/ | |
# Step 5: Commit and push changes to the Wiki | |
- name: Update Wiki | |
run: | | |
cd wiki | |
git config user.name "GitHub Action" | |
git config user.email "action@github.com" | |
git add schema.md | |
git commit -m "Update schema documentation" | |
git push |