2
0

api-docs.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Build and publish API docs
  2. on:
  3. push:
  4. branches: [v1_release, v2_develop]
  5. permissions:
  6. id-token: write
  7. pages: write
  8. jobs:
  9. deploy:
  10. name: Build and Deploy API docs to github-pages ${{ github.ref_name }}
  11. environment:
  12. name: github-pages
  13. url: ${{ steps.deployment.outputs.page_url }}
  14. runs-on: windows-latest
  15. steps:
  16. - name: Checkout
  17. if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
  18. uses: actions/checkout@v4
  19. - name: DocFX Build
  20. if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
  21. working-directory: docfx
  22. run: |
  23. dotnet tool install -g docfx
  24. $env:DOCFX_SOURCE_BRANCH_NAME="${{ github.ref_name }}"
  25. docfx metadata
  26. docfx build
  27. continue-on-error: false
  28. - name: Setup Pages
  29. if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
  30. uses: actions/configure-pages@v5
  31. - name: Upload artifact
  32. if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
  33. uses: actions/upload-pages-artifact@v3
  34. with:
  35. path: docfx/_site
  36. - name: Deploy to GitHub Pages
  37. if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
  38. id: deployment
  39. uses: actions/deploy-pages@v4
  40. with:
  41. token: ${{ secrets.GITHUB_TOKEN }}
  42. - name: v2_develop Repository Dispatch ${{ github.ref_name }}
  43. if: github.ref_name == 'v2_develop'
  44. uses: peter-evans/repository-dispatch@v3
  45. with:
  46. token: ${{ secrets.V2DOCS_TOKEN }}
  47. repository: gui-cs/Terminal.GuiV2Docs
  48. event-type: v2_develop_push
  49. client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'