| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- name: Generate DarkFi Book
- on:
- push:
- branches:
- - master
- jobs:
- compile-book:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- with:
- persist-credentials: false
- fetch-depth: 0
- - name: Install Python
- uses: actions/setup-python@v1
- with:
- python-version: 3.9
- - name: Install Rust
- uses: actions-rs/toolchain@v1
- with:
- toolchain: stable
- override: true
- components: rustfmt, clippy
- - uses: Swatinem/rust-cache@v1
- - name: Install ghp-import and mdbook
- run: |
- pip install ghp-import
- sudo apt -y install make wget
- wget "https://github.com/badboy/mdbook-toc/releases/download/0.10.0/mdbook-toc-0.10.0-x86_64-unknown-linux-gnu.tar.gz"
- wget "https://github.com/lzanini/mdbook-katex/releases/download/v0.2.18/mdbook-katex-v0.2.18-x86_64-unknown-linux-gnu.tar.gz"
- wget "https://github.com/badboy/mdbook-mermaid/releases/download/v0.12.3/mdbook-mermaid-v0.12.3-x86_64-unknown-linux-gnu.tar.gz"
- wget "https://github.com/rust-lang/mdBook/releases/download/v0.4.22/mdbook-v0.4.22-x86_64-unknown-linux-gnu.tar.gz"
- for i in *.tar.gz; do
- tar xf "$i"
- rm -f "$i"
- done
- mkdir -p "$HOME/bin"
- mv -v mdbook* "$HOME/bin"
- export PATH="$HOME/bin:$PATH"
- - name: Compile and publish the book
- run: |
- git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
- git config --local user.name "parazyd"
- cd doc
- make github
- git checkout gh-pages
- - name: Push changes
- uses: ad-m/github-push-action@master
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- branch: gh-pages
|