mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-16 07:26:35 +00:00
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:
39
.github/workflows/build_n_push.yml
vendored
39
.github/workflows/build_n_push.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user