docs.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: Documentation
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. branches:
  8. - main
  9. permissions:
  10. contents: read
  11. pages: write
  12. id-token: write
  13. concurrency:
  14. group: pages
  15. cancel-in-progress: false
  16. jobs:
  17. # Runs on pull requests too, so a broken build is caught before it merges.
  18. build:
  19. name: Build
  20. runs-on: ubuntu-latest
  21. steps:
  22. - uses: actions/checkout@v7
  23. - uses: actions/configure-pages@v6
  24. # uv installs from the committed uv.lock, so the build is reproducible.
  25. - uses: astral-sh/setup-uv@v10.0.1
  26. with:
  27. enable-cache: true
  28. - run: uv run zensical build --clean
  29. - uses: actions/upload-pages-artifact@v5
  30. with:
  31. path: site
  32. deploy:
  33. name: Deploy
  34. if: github.event_name == 'push' && github.ref == 'refs/heads/main'
  35. needs: build
  36. environment:
  37. name: github-pages
  38. url: ${{ steps.deployment.outputs.page_url }}
  39. runs-on: ubuntu-latest
  40. steps:
  41. - uses: actions/deploy-pages@v5
  42. id: deployment