From 28f07815fb970a6ce37f012cb3f4663192175c1c Mon Sep 17 00:00:00 2001 From: peterxcli Date: Sun, 14 Jan 2024 00:22:43 +0800 Subject: [PATCH] feat: add auto deploy swagger api --- .github/workflows/docs.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/docs.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..5402a5d --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,22 @@ + on: + push: + branches: + - main + jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Generate Swagger UI + uses: Legion2/swagger-ui-action@v1 + with: + output: swagger-ui + spec-file: docs/swagger.json + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: swagger-ui