diff --git a/.github/workflows/api-docs.yml b/.github/workflows/api-docs.yml index f529cd3615..8fcebfdd4a 100644 --- a/.github/workflows/api-docs.yml +++ b/.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/docfx-action@v1.0.0 + - 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/docfx-action@v1.0.0 + # with: + # args: docfx/docfx.json # # Publish generated site using GitHub Pages # - uses: maxheld83/ghpages@master