From 067c1c96251ebba850c086de131db2ba9c5cc699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Uhl=C3=AD=C5=99?= Date: Thu, 23 Mar 2023 12:19:33 +0100 Subject: [PATCH] ci: lint openapi on all prs (#381) --- .github/workflows/docs.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 174ebeae..4a3bf03b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,12 +7,12 @@ on: paths: - 'openapi.yaml' - '.github/workflows/docs.yml' -# pull_request: -# branches: -# - '**' -# 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: @@ -21,8 +21,8 @@ permissions: id-token: write jobs: - build: - name: Preview + lint: + name: Lint runs-on: ubuntu-latest steps: - name: Checkout @@ -38,6 +38,20 @@ jobs: shell: bash 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 shell: bash run: npx @redocly/cli build-docs openapi.yaml --output "openapi/index.html" --title "Codex API"