deploy-docs.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. defaults:
  14. run:
  15. working-directory: docs
  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: Install dependencies
  26. run: npm ci
  27. - name: Build website
  28. run: npm run build
  29. - name: Upload Build Artifact
  30. if: github.ref == 'refs/heads/main'
  31. uses: actions/upload-pages-artifact@v3
  32. with:
  33. path: docs/build
  34. deploy:
  35. name: Deploy to GitHub Pages
  36. needs: build
  37. if: github.ref == 'refs/heads/main'
  38. # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
  39. permissions:
  40. pages: write # to deploy to Pages
  41. id-token: write # to verify the deployment originates from an appropriate source
  42. # Deploy to the github-pages environment
  43. environment:
  44. name: github-pages
  45. url: ${{ steps.deployment.outputs.page_url }}
  46. runs-on: ubuntu-latest
  47. steps:
  48. - name: Deploy to GitHub Pages
  49. id: deployment
  50. uses: actions/deploy-pages@v4