Add workflow for api gen and refactor genration script (#60)

* update gitignore

* add first version of api generation flow

* try to run flow

* testing flow

* update gen flow

* switch flow to macOS

* fix

* add npm install

* test workflow

* Update API pages

* test workflow with current main

* refactor parser

* merge examples and schema functions

* merge examples and schema functions

* merge parameters as well

* revert template to single class component

* update account

* finalizing

* update with the newest version of openapi

* full flow

* update

* add docker command

* split flow in two jobs

* remove testing trigger

---------

Co-authored-by: GitHub Actions <no-reply@github.com>
This commit is contained in:
pascal-fischer
2023-06-05 09:35:54 +02:00
committed by GitHub
parent 33b3153723
commit f33b4df3dd
20 changed files with 481 additions and 5928 deletions

View File

@@ -5,13 +5,44 @@ on:
- main
tags:
- "**"
pull_request:
workflow_dispatch:
inputs:
generateAPI:
description: 'Generates API pages if set'
required: false
default: false
type: boolean
jobs:
docs_build_n_push:
runs-on: ubuntu-latest
generate_api_pages:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install swagger-codegen
if: ${{ inputs.generateAPI }}
run: brew install swagger-codegen
- name: Generate api pages for netbird main openapi definition
if: ${{ inputs.generateAPI }}
run: |
npm install
npm run gen
- name: Commit and push changes
if: ${{ inputs.generateAPI }}
run: |
git config --global user.email "no-reply@github.com"
git config --global user.name "GitHub Actions"
git add -A
git commit -m "Update API pages"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push
docs_build_n_push:
runs-on: ubuntu-latest
needs: [generate_api_pages]
steps:
-
name: Docker meta
id: meta