From 09187604647c1a6de2d22d3f9ba273f24ee01c35 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Mon, 5 Dec 2022 08:55:04 -0800 Subject: [PATCH] add API document github page (#1114) * Doc (#66) * add doc * ln -s md * add pipeline * Update docfx.yaml * Update docfx.yaml * Update docfx.yaml * Update docfx.yaml * Update toc.yml --- .github/workflows/docfx.yaml | 57 ++++++++++++++++++++++++++++++++++++ doc/.gitignore | 11 +++++++ doc/docfx.json | 42 ++++++++++++++++++++++++++ doc/index.md | 1 + doc/toc.yml | 2 ++ 5 files changed, 113 insertions(+) create mode 100644 .github/workflows/docfx.yaml create mode 100644 doc/.gitignore create mode 100644 doc/docfx.json create mode 120000 doc/index.md create mode 100644 doc/toc.yml diff --git a/.github/workflows/docfx.yaml b/.github/workflows/docfx.yaml new file mode 100644 index 0000000..fcfaa80 --- /dev/null +++ b/.github/workflows/docfx.yaml @@ -0,0 +1,57 @@ +name: Docfx + +on: + push: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + docfx: + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 3.1.x + 5.0.x + 6.0.x + + - name: Build + run: dotnet build + + - uses: nikeee/docfx-action@v1.0.0 + name: Build Documentation + with: + args: doc/docfx.json + + - name: Setup Pages + uses: actions/configure-pages@v2 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + # Upload entire repository + path: doc/_site + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000..2f16432 --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,11 @@ +############### +# folder # +############### +/**/DROP/ +/**/TEMP/ +/**/packages/ +/**/bin/ +/**/obj/ +_site + +api \ No newline at end of file diff --git a/doc/docfx.json b/doc/docfx.json new file mode 100644 index 0000000..44b7e77 --- /dev/null +++ b/doc/docfx.json @@ -0,0 +1,42 @@ +{ + "metadata": [ + { + "src": [ + { + "files": [ + "KubernetesClient.Basic/bin/Debug/netstandard2.0/KubernetesClient.Basic.dll", + "KubernetesClient.Models/bin/Debug/netstandard2.0/KubernetesClient.Models.dll", + "KubernetesClient/KubernetesClient.csproj" + ], + "src": "../src" + } + ], + "dest": "api", + "disableGitFeatures": false, + "disableDefaultFilter": false + } + ], + "build": { + "content": [ + { + "files": [ + "api/**.yml", + "index.md", + "toc.yml" + ] + } + ], + "dest": "_site", + "globalMetadataFiles": [], + "fileMetadataFiles": [], + "template": [ + "default" + ], + "postProcessors": [], + "markdownEngineName": "markdig", + "noLangKeyword": false, + "keepFileLink": false, + "cleanupCacheHistory": false, + "disableGitFeatures": false + } +} \ No newline at end of file diff --git a/doc/index.md b/doc/index.md new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/doc/index.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/doc/toc.yml b/doc/toc.yml new file mode 100644 index 0000000..8bf2c8e --- /dev/null +++ b/doc/toc.yml @@ -0,0 +1,2 @@ +- name: API Documentation + href: api/k8s.yml