mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-12 16:35:21 +00:00
53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
name: Book
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
paths:
|
|
- 'book/**'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
MDBOOK_VERSION: '0.4.0'
|
|
MDBOOK_LINKCHECK_VERSION: '0.7.0'
|
|
MDBOOK_MERMAID_VERSION: '^0.4'
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cargo/bin
|
|
key: ${{ env.MDBOOK_MERMAID_VERSION }}
|
|
- name: Install mdbook
|
|
run: |
|
|
mkdir -p $HOME/mdbook $HOME/mdbook-linkcheck
|
|
curl -L https://github.com/rust-lang/mdBook/releases/download/v$MDBOOK_VERSION/mdbook-v$MDBOOK_VERSION-x86_64-unknown-linux-gnu.tar.gz | tar xz -C $HOME/mdbook
|
|
echo "::add-path::${HOME}/mdbook/"
|
|
curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v$MDBOOK_LINKCHECK_VERSION/mdbook-linkcheck-v$MDBOOK_LINKCHECK_VERSION-x86_64-unknown-linux-gnu.tar.gz | tar xz -C $HOME/mdbook-linkcheck
|
|
echo "::add-path::${HOME}/mdbook-linkcheck/"
|
|
mdbook-mermaid --version || cargo install mdbook-mermaid --version $MDBOOK_MERMAID_VERSION --debug
|
|
- name: Build
|
|
run: mdbook build
|
|
working-directory: book
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: book
|
|
path: book/book/html
|
|
|
|
deploy:
|
|
name: Deploy
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
steps:
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: book
|
|
- uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: .
|