Skip to content

Commit

Permalink
added gh action to generate the openapi json file
Browse files Browse the repository at this point in the history
Signed-off-by: Surax98 <[email protected]>
  • Loading branch information
Surax98 committed Jul 24, 2024
1 parent 9738668 commit 3fa9977
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build_openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Update OpenAPI

on:
push:
tags:
- '*'
branches:
- '**'

jobs:
update-openapi:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x' # specify the Python version you need

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r example/requirements.txt # if you have a requirements file
- name: Run script to generate OpenAPI JSON
run: python example/create_openapi.py

- name: Create a new release
id: create_release
uses: softprops/action-gh-release@v2
with:
files: docs/openapi/openapi.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.sha }}
release_name: 'Release ${{ github.sha }}'
draft: false
prerelease: false

# - name: Upload OpenAPI JSON as an artifact
# uses: actions/upload-artifact@v4
# with:
# name: openapi.json
# path: ./docs/openapi/openapi.json

0 comments on commit 3fa9977

Please sign in to comment.