OpenAPI action #1
Workflow file for this run
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 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 |