Slava cfe9225be1
Fix Open API workflow branch (codex-storage/infra-codex/issues/5) (#442)
Signed-off-by: Slava <20563034+veaceslavdoina@users.noreply.github.com>
2023-06-12 12:34:44 +03:00

66 lines
1.3 KiB
YAML

name: OpenAPI
on:
push:
branches:
- 'master'
paths:
- 'openapi.yaml'
- '.github/workflows/docs.yml'
pull_request:
branches:
- '**'
paths:
- 'openapi.yaml'
- '.github/workflows/docs.yml'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Lint OpenAPI
shell: bash
run: npx @redocly/cli lint openapi.yaml
deploy:
name: Deploy
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Build OpenAPI
shell: bash
run: npx @redocly/cli build-docs openapi.yaml --output "openapi/index.html" --title "Codex API"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './openapi'
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v1