From f6ba2278d3dcbb0afe9d30379490dd0703b06ed7 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Sun, 4 Dec 2022 05:04:25 -0800 Subject: [PATCH 1/6] Doc (#66) * add doc * ln -s md * add pipeline --- .github/workflows/docfx.yaml | 37 +++++++++++++++++++++++++++++++ doc/.gitignore | 11 ++++++++++ doc/docfx.json | 42 ++++++++++++++++++++++++++++++++++++ doc/index.md | 1 + doc/toc.yml | 2 ++ 5 files changed, 93 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 000000000..70b1ab03d --- /dev/null +++ b/.github/workflows/docfx.yaml @@ -0,0 +1,37 @@ +name: Docfx + +on: + push: + branches: [ master ] + +jobs: + docfx: + runs-on: ubuntu-latest + name: A job to say hello + 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: path/to/your/docfx.json + + # Publish generated site using GitHub Pages + - uses: maxheld83/ghpages@master + name: Publish Documentation on GitHub Pages + env: + BUILD_DIR: _site # docfx's default output directory is _site + GH_PAT: ${{ secrets.GH_PAT }} # See https://github.com/maxheld83/ghpages \ No newline at end of file diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 000000000..2f16432e9 --- /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 000000000..44b7e7785 --- /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 000000000..32d46ee88 --- /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 000000000..672ef2d4b --- /dev/null +++ b/doc/toc.yml @@ -0,0 +1,2 @@ +- name: Documentation + href: api/k8s.yml From 9e5ed4444fc2f52575574e2b39a58125f1a846f5 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Sun, 4 Dec 2022 05:09:13 -0800 Subject: [PATCH 2/6] Update docfx.yaml --- .github/workflows/docfx.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docfx.yaml b/.github/workflows/docfx.yaml index 70b1ab03d..dde83dd8e 100644 --- a/.github/workflows/docfx.yaml +++ b/.github/workflows/docfx.yaml @@ -27,11 +27,11 @@ jobs: - uses: nikeee/docfx-action@v1.0.0 name: Build Documentation with: - args: path/to/your/docfx.json + args: doc/docfx.json # Publish generated site using GitHub Pages - uses: maxheld83/ghpages@master name: Publish Documentation on GitHub Pages env: - BUILD_DIR: _site # docfx's default output directory is _site - GH_PAT: ${{ secrets.GH_PAT }} # See https://github.com/maxheld83/ghpages \ No newline at end of file + BUILD_DIR: doc/_site # docfx's default output directory is _site + GH_PAT: ${{ secrets.GH_PAT }} # See https://github.com/maxheld83/ghpages From f252a81482165cdeb9ee170c2d9bb1259bd0426d Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Sun, 4 Dec 2022 05:09:56 -0800 Subject: [PATCH 3/6] Update docfx.yaml --- .github/workflows/docfx.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docfx.yaml b/.github/workflows/docfx.yaml index dde83dd8e..87cdbab84 100644 --- a/.github/workflows/docfx.yaml +++ b/.github/workflows/docfx.yaml @@ -7,7 +7,6 @@ on: jobs: docfx: runs-on: ubuntu-latest - name: A job to say hello steps: - uses: actions/checkout@v3 with: From 41b1b922c774268bd989387de9326a3256185715 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Sun, 4 Dec 2022 06:49:50 -0800 Subject: [PATCH 4/6] Update docfx.yaml --- .github/workflows/docfx.yaml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docfx.yaml b/.github/workflows/docfx.yaml index 87cdbab84..a8297efb9 100644 --- a/.github/workflows/docfx.yaml +++ b/.github/workflows/docfx.yaml @@ -7,6 +7,9 @@ on: jobs: docfx: runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - uses: actions/checkout@v3 with: @@ -28,9 +31,13 @@ jobs: with: args: doc/docfx.json - # Publish generated site using GitHub Pages - - uses: maxheld83/ghpages@master - name: Publish Documentation on GitHub Pages - env: - BUILD_DIR: doc/_site # docfx's default output directory is _site - GH_PAT: ${{ secrets.GH_PAT }} # See https://github.com/maxheld83/ghpages + - 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 From ac62ee834de75d0641e1ebe2328c4d2a19fe9dd9 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Sun, 4 Dec 2022 06:55:29 -0800 Subject: [PATCH 5/6] Update docfx.yaml --- .github/workflows/docfx.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/docfx.yaml b/.github/workflows/docfx.yaml index a8297efb9..fcfaa80a3 100644 --- a/.github/workflows/docfx.yaml +++ b/.github/workflows/docfx.yaml @@ -4,6 +4,20 @@ 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 From 58a4168ad923957b4efe41c574a23419847858c1 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Sun, 4 Dec 2022 07:11:46 -0800 Subject: [PATCH 6/6] Update toc.yml --- doc/toc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/toc.yml b/doc/toc.yml index 672ef2d4b..8bf2c8ed1 100644 --- a/doc/toc.yml +++ b/doc/toc.yml @@ -1,2 +1,2 @@ -- name: Documentation +- name: API Documentation href: api/k8s.yml