deploy-docs.yml 1.6 KB

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