deploy-docs.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Workflow that builds and deploys the documentation website
  2. name: Deploy Docs to GitHub Pages
  3. on:
  4. push:
  5. branches:
  6. - main
  7. pull_request:
  8. paths:
  9. - 'docs/**'
  10. branches:
  11. - main
  12. jobs:
  13. # Build the documentation website
  14. build:
  15. name: Build Docusaurus
  16. runs-on: ubuntu-latest
  17. if: github.repository == 'OpenDevin/OpenDevin'
  18. steps:
  19. - uses: actions/checkout@v4
  20. with:
  21. fetch-depth: 0
  22. - uses: actions/setup-node@v4
  23. with:
  24. node-version: 18
  25. cache: npm
  26. cache-dependency-path: docs/package-lock.json
  27. - name: Set up Python
  28. uses: actions/setup-python@v5
  29. with:
  30. python-version: '3.11'
  31. - name: Generate Python Docs
  32. run: rm -rf docs/modules/python && pip install pydoc-markdown && pydoc-markdown
  33. - name: Install dependencies
  34. run: cd docs && npm ci
  35. - name: Build website
  36. run: cd docs && npm run build
  37. - name: Upload Build Artifact
  38. if: github.ref == 'refs/heads/main'
  39. uses: actions/upload-pages-artifact@v3
  40. with:
  41. path: docs/build
  42. # Deploy the documentation website
  43. deploy:
  44. name: Deploy to GitHub Pages
  45. runs-on: ubuntu-latest
  46. needs: build
  47. if: github.ref == 'refs/heads/main' && github.repository == 'OpenDevin/OpenDevin'
  48. # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
  49. permissions:
  50. pages: write # to deploy to Pages
  51. id-token: write # to verify the deployment originates from an appropriate source
  52. # Deploy to the github-pages environment
  53. environment:
  54. name: github-pages
  55. url: ${{ steps.deployment.outputs.page_url }}
  56. steps:
  57. - name: Deploy to GitHub Pages
  58. id: deployment
  59. uses: actions/deploy-pages@v4