Decouple api generation flow from docker build (#62)

* decouple api generation from docker build

* add different PAT
This commit is contained in:
pascal-fischer
2023-06-12 14:47:20 +02:00
committed by GitHub
parent 44f2a02a25
commit d18f5c076f
2 changed files with 44 additions and 36 deletions

View File

@@ -3,46 +3,11 @@ on:
push:
branches:
- main
tags:
- "**"
workflow_dispatch:
inputs:
generateAPI:
description: 'Generates API pages if set'
required: false
default: false
type: boolean
jobs:
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:
- uses: actions/checkout@v2
-
name: Docker meta
id: meta