docs-pr.yaml 988 B

12345678910111213141516171819202122232425262728293031323334
  1. name: Prepare documentation PR preview
  2. on:
  3. pull_request:
  4. paths:
  5. - docs/**
  6. jobs:
  7. pages:
  8. name: GitHub Pages
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v2
  12. - name: Setup mdbook
  13. uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea # v1.2.0
  14. with:
  15. mdbook-version: '0.4.17'
  16. - name: Build the documentation
  17. # mdbook will only create an index.html if we're including docs/README.md in SUMMARY.md.
  18. # However, we're using docs/README.md for other purposes and need to pick a new page
  19. # as the default. Let's opt for the welcome page instead.
  20. run: |
  21. mdbook build
  22. cp book/welcome_and_overview.html book/index.html
  23. - name: Upload Artifact
  24. uses: actions/upload-artifact@v3
  25. with:
  26. name: book
  27. path: book
  28. # We'll only use this in a workflow_run, then we're done with it
  29. retention-days: 1