book.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: Generate DarkFi Book
  2. on:
  3. push:
  4. branches:
  5. - master
  6. jobs:
  7. compile-book:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v2
  11. with:
  12. persist-credentials: false
  13. fetch-depth: 0
  14. - name: Install Python
  15. uses: actions/setup-python@v1
  16. with:
  17. python-version: 3.9
  18. - name: Install Rust
  19. uses: actions-rs/toolchain@v1
  20. with:
  21. toolchain: stable
  22. override: true
  23. components: rustfmt, clippy
  24. - name: Install ghp-import and mdbook
  25. run: |
  26. pip install ghp-import
  27. cargo install mdbook
  28. export PATH="$HOME/.cargo/bin:$PATH"
  29. cargo install --git "https://github.com/lzanini/mdbook-katex"
  30. sudo apt -y install make
  31. - name: Compile and publish the book
  32. run: |
  33. git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
  34. git config --local user.name "parazyd"
  35. cd book
  36. make github
  37. git checkout gh-pages
  38. - name: Push changes
  39. uses: ad-m/github-push-action@master
  40. with:
  41. github_token: ${{ secrets.GITHUB_TOKEN }}
  42. branch: gh-pages