mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-16 15:36:36 +00:00
Decouple api generation flow from docker build (#62)
* decouple api generation from docker build * add different PAT
This commit is contained in:
37
.github/workflows/build_n_push.yml
vendored
37
.github/workflows/build_n_push.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user