Skip to content

Commit

Permalink
Implemented workflow to automate api documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
varshadr committed Nov 1, 2023
1 parent 8b5d433 commit 3daa6e7
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/update-api-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Generate API documentation

on:
push_request:
branches:
- develop

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build Docker image
run: docker compose -f docker-compose.yml -f docker-compose.dev.yml up dev-service

- name: Generate API documentation
uses: addnab/docker-run-action@v3
with:
image: mathesar/mathesar-dev:latest
run: ./manage.py spectacular --color --file schema.yml

- name: Check if schema file has changed
run: git diff --quiet schema.yml || exit 0

- name: Commit schema file
run: git add schema.yml && git commit -m "Add schema file"

- name: Push changes to remote branch
run: git push origin ${{ github.head_ref }}

0 comments on commit 3daa6e7

Please sign in to comment.