deploy-docs.yml 1.6 KB

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