Explorar o código

Try 3 - Fixes #1745 - Github action to generate API docs

Charlie Kindel %!s(int64=2) %!d(string=hai) anos
pai
achega
fc1d7d44fd
Modificáronse 1 ficheiros con 35 adicións e 7 borrados
  1. 35 7
      .github/workflows/api-docs.yml

+ 35 - 7
.github/workflows/api-docs.yml

@@ -5,16 +5,44 @@ on:
     branches: [main]
 
 jobs:
-  build:
-    runs-on: ubuntu-latest
+  generate-docs:
+    runs-on: windows-latest
 
     steps:
-    - uses: actions/checkout@v1
-    # ...
-    - name: Use docfx to build API Docs
-      uses: nikeee/[email protected]
+    - name: Checkout
+      uses: actions/checkout@v2
+
+    - name: Setup .NET Core
+      uses: actions/setup-dotnet@v1
+      with:
+        dotnet-version: 6.0.100
+    
+    - name: Setup DocFX
+      uses: crazy-max/ghaction-chocolatey@v1
       with:
-        args: docfx/docfx.json
+        args: install docfx    
+
+    - name: Install dependencies
+      run: dotnet restore        
+
+    - name: DocFX Build
+      working-directory: docfx
+      run: del ../docs /F /S
+      run: docfx docfx.json
+      continue-on-error: false      
+
+      - name: Publish
+        if: github.event_name == 'push'
+        uses: peaceiris/actions-gh-pages@v3
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+          publish_dir: docs
+          force_orphan: true
+
+    # - name: Use docfx to build API Docs
+    #   uses: nikeee/[email protected]
+    #   with:
+    #     args: docfx/docfx.json
 
     # # Publish generated site using GitHub Pages
     # - uses: maxheld83/ghpages@master