hosted/.forgejo/workflows/build.yml
Ashley Graves 7b7360be0f
bah
2024-10-26 22:52:45 +02:00

51 lines
1.2 KiB
YAML

name: Update API Documentation
on:
workflow_dispatch:
push:
paths:
- 'openapi.yaml'
branches:
- main
jobs:
convert-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout wiki
uses: actions/checkout@v3
with:
repository: ${{github.repository}}.wiki
path: wiki
ref: main
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Widdershins
run: npm install -g widdershins
- name: Convert OpenAPI to Markdown
run: |
widdershins openapi.yaml -o wiki/api.md --omitHeader true --summary true --expandBody true --code false
- name: Configure Git
run: |
cd wiki
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Commit and push changes to wiki
run: |
cd wiki
git add api.md
git diff-index --quiet HEAD || git commit -m "Update API documentation"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}