ci: lint openapi on all prs (#381)
This commit is contained in:
parent
b2048377e8
commit
067c1c9625
|
@ -7,12 +7,12 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- 'openapi.yaml'
|
- 'openapi.yaml'
|
||||||
- '.github/workflows/docs.yml'
|
- '.github/workflows/docs.yml'
|
||||||
# pull_request:
|
pull_request:
|
||||||
# branches:
|
branches:
|
||||||
# - '**'
|
- '**'
|
||||||
# paths:
|
paths:
|
||||||
# - 'openapi.yaml'
|
- 'openapi.yaml'
|
||||||
# - '.github/workflows/docs.yml'
|
- '.github/workflows/docs.yml'
|
||||||
|
|
||||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||||
permissions:
|
permissions:
|
||||||
|
@ -21,8 +21,8 @@ permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
lint:
|
||||||
name: Preview
|
name: Lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@ -38,6 +38,20 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: npx @redocly/cli lint openapi.yaml
|
run: npx @redocly/cli lint openapi.yaml
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
name: Deploy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: '0'
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
|
||||||
- name: Build OpenAPI
|
- name: Build OpenAPI
|
||||||
shell: bash
|
shell: bash
|
||||||
run: npx @redocly/cli build-docs openapi.yaml --output "openapi/index.html" --title "Codex API"
|
run: npx @redocly/cli build-docs openapi.yaml --output "openapi/index.html" --title "Codex API"
|
||||||
|
|
Loading…
Reference in New Issue