book.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. cargo install --git "https://github.com/badboy/mdbook-mermaid"
  33. sudo apt -y install make
  34. - name: Compile and publish the book
  35. run: |
  36. git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
  37. git config --local user.name "parazyd"
  38. cd doc
  39. make github
  40. git checkout gh-pages
  41. - name: Push changes
  42. uses: ad-m/github-push-action@master
  43. with:
  44. github_token: ${{ secrets.GITHUB_TOKEN }}
  45. branch: gh-pages