Giter VIP home page Giter VIP logo

swagger-ui-action's Introduction

Swagger UI Action build-test

Generate Swagger UI static html files and configuration to be deployed to GitHub Pages.

This action only works on linux runners.

How to Use

This Action supports four different configuration modes:

  • spec-file: File path to local OpenAPI or Swagger specification document
  • spec-url: URL of an OpenAPI or Swagger specification document
  • swagger-config-file: File path to local swagger configuration file
  • swagger-config-url: URL of a swagger configuration file

Use spec-file or spec-url when you have an OpenAPI or Swagger specification document and want a basic Swagger UI generated for it. If you want to customize the created Swagger UI, you should use the swagger-config-file or the swagger-config-url configuration modes. For information about the advanced swagger-config see the Swagger UI Configuration documentation.

The output directory of the generated Swagger UI must be set with the output argument of the Action. Optionally the Swagger UI version can be set with the version input, it accepts semver ranges.

Example

This Action only generates the Swagger UI. For example, to deploy it to GitHub Pages another Action is required.

Example steps from a workflow to generate and deploy Swagger UI to GitHub Pages:

      - name: Generate Swagger UI
        uses: Legion2/swagger-ui-action@v1
        with:
          output: swagger-ui
          spec-file: openapi.json
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: swagger-ui

For a full example have a look at this workflow file.

Development

The Action runs from GitHub this repo, so the packed dist folder must be added to git.

Release a new version:

$ npm run package
$ git commit -a -m "distribution"
$ npm version major/minor/patch
$ git tag -fa v1 -m "Update v1 tag"
$ git push origin v1 --force

versioning documentation

swagger-ui-action's People

Contributors

dependabot[bot] avatar legion2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.