2
0

api-docs.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. uses: actions/checkout@v4
  18. - name: DocFX Build
  19. #if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
  20. working-directory: docfx
  21. run: |
  22. dotnet tool install -g docfx
  23. $env:DOCFX_SOURCE_BRANCH_NAME="${{ github.ref_name }}"
  24. docfx metadata
  25. docfx build
  26. continue-on-error: false
  27. - name: Setup Pages
  28. #if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
  29. uses: actions/configure-pages@v5
  30. - name: Upload artifact
  31. #if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
  32. uses: actions/upload-pages-artifact@v3
  33. with:
  34. path: docfx/_site
  35. - name: Deploy to GitHub Pages
  36. if: github.ref_name == 'v2_release' || github.ref_name == 'v2_develop'
  37. id: deployment
  38. uses: actions/deploy-pages@v4
  39. with:
  40. token: ${{ secrets.GITHUB_TOKEN }}
  41. # - name: v1_release Repository Dispatch ${{ github.ref_name }}
  42. # if: github.ref_name == 'v2_develop'
  43. # uses: peter-evans/repository-dispatch@v3
  44. # with:
  45. # token: ${{ secrets.V2DOCS_TOKEN }}
  46. # repository: gui-cs/Terminal.GuiV1Docs
  47. # event-type: v2_develop_push
  48. # client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'