api-docs.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Build and publish API docs
  2. on:
  3. push:
  4. branches: [main]
  5. jobs:
  6. generate-docs:
  7. runs-on: windows-latest
  8. steps:
  9. - name: Checkout
  10. uses: actions/checkout@v4
  11. - name: Setup .NET Core
  12. uses: actions/[email protected]
  13. with:
  14. dotnet-version: 6.0.100
  15. - name: Setup DocFX
  16. uses: crazy-max/ghaction-chocolatey@v2
  17. with:
  18. args: install docfx
  19. - name: Install dependencies
  20. run: dotnet restore
  21. - name: DocFX Build
  22. working-directory: docfx
  23. # https://stackoverflow.com/questions/56726429/how-to-run-multiple-commands-in-one-github-actions-docker
  24. run: |
  25. rm ../docs -Recurse -Force -ErrorAction SilentlyContinue
  26. docfx docfx.json
  27. continue-on-error: false
  28. - name: Publish
  29. if: github.event_name == 'push'
  30. uses: peaceiris/actions-gh-pages@v3
  31. with:
  32. github_token: ${{ secrets.GITHUB_TOKEN }}
  33. publish_dir: docs
  34. force_orphan: true
  35. # - name: Use docfx to build API Docs
  36. # uses: nikeee/[email protected]
  37. # with:
  38. # args: docfx/docfx.json
  39. # # Publish generated site using GitHub Pages
  40. # - uses: maxheld83/ghpages@master
  41. # name: Publish API Documentation on GitHub Pages
  42. # env:
  43. # BUILD_DIR: docs # docfx's default output directory is _site
  44. # GH_PAT: ${{ secrets.GH_PAT }} # See https://github.com/maxheld83/ghpages