book.yml 1.5 KB

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