From b9e1d36ccc7698cb85edc56fba45c614123ff314 Mon Sep 17 00:00:00 2001 From: Lucky3028 Date: Mon, 26 Dec 2022 23:39:04 +0900 Subject: [PATCH] ci: run redocly-cli directly --- .github/actions/install-redocly-cli/action.yml | 8 ++++++++ .github/actions/redocly-cli/action.yml | 12 ------------ .github/workflows/lint-openapi.yml | 16 ++++++++-------- .github/workflows/pub-docs.yml | 8 ++++---- 4 files changed, 20 insertions(+), 24 deletions(-) create mode 100644 .github/actions/install-redocly-cli/action.yml delete mode 100644 .github/actions/redocly-cli/action.yml diff --git a/.github/actions/install-redocly-cli/action.yml b/.github/actions/install-redocly-cli/action.yml new file mode 100644 index 0000000..6a5548e --- /dev/null +++ b/.github/actions/install-redocly-cli/action.yml @@ -0,0 +1,8 @@ +name: install-redocly-cli +description: Install redocly-cli +runs: + using: composite + steps: + - name: Install redocly-cli + run: npm install -g @redocly/cli + shell: bash diff --git a/.github/actions/redocly-cli/action.yml b/.github/actions/redocly-cli/action.yml deleted file mode 100644 index 96451bc..0000000 --- a/.github/actions/redocly-cli/action.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: redocly-cli -description: Run redocly-cli -inputs: - command-args: - description: Args to pass to the CLI - required: true -runs: - using: composite - steps: - - name: Run redocly-cli - run: docker run --rm -v $PWD:/spec redocly/cli ${{ inputs.command-args }} - shell: bash diff --git a/.github/workflows/lint-openapi.yml b/.github/workflows/lint-openapi.yml index 1ad72ad..e50434e 100644 --- a/.github/workflows/lint-openapi.yml +++ b/.github/workflows/lint-openapi.yml @@ -10,20 +10,20 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Lint - uses: ./.github/actions/redocly-cli - with: - command-args: lint /spec/schema/openapi.yml + - name: Install redocly-cli + uses: ./.github/actions/install-redocly-cli + - name: Lint OpenAPI yml + run: lint ./schema/openapi.yml lint-examples: name: Lint examples of OpenAPI runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Install redocly-cli + uses: ./.github/actions/install-redocly-cli - name: Bundle OpenAPI yml - uses: ./.github/actions/redocly-cli - with: - command-args: bundle /spec/schema/openapi.yml -o /spec/bundled-openapi.yml - - name: Install a lib + run: bundle ./schema/openapi.yml -o ./schema/bundled-openapi.yml + - name: Install openapi-examples-validator run: npm install -g openapi-examples-validator - name: Lint examples run: openapi-examples-validator ./bundled-openapi.yml diff --git a/.github/workflows/pub-docs.yml b/.github/workflows/pub-docs.yml index 2e26917..c72def8 100644 --- a/.github/workflows/pub-docs.yml +++ b/.github/workflows/pub-docs.yml @@ -21,10 +21,10 @@ jobs: - lint steps: - uses: actions/checkout@v3 - - name: Bundle - uses: ./.github/actions/redocly-cli - with: - command-args: build-docs /spec/schema/openapi.yml -o /spec/docs/index.html -t /spec/.github/template.hbs + - name: Install redocly-cli + uses: ./.github/actions/install-redocly-cli + - name: Build docs + run: build-docs ./schema/openapi.yml -o ./docs/index.html -t ./.github/template.hbs - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: