book.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. - uses: Swatinem/rust-cache@v1
  25. - name: Install ghp-import and mdbook
  26. run: |
  27. pip install ghp-import
  28. cargo install mdbook
  29. export PATH="$HOME/.cargo/bin:$PATH"
  30. cargo install --git "https://github.com/lzanini/mdbook-katex"
  31. cargo install --git "https://github.com/badboy/mdbook-toc"
  32. sudo apt -y install make
  33. - name: Compile and publish the book
  34. run: |
  35. git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
  36. git config --local user.name "parazyd"
  37. cd doc
  38. make github
  39. git checkout gh-pages
  40. - name: Push changes
  41. uses: ad-m/github-push-action@master
  42. with:
  43. github_token: ${{ secrets.GITHUB_TOKEN }}
  44. branch: gh-pages