salsa/.github/workflows/book.yml

50 lines
1.6 KiB
YAML
Raw Normal View History

2020-06-24 18:22:51 +00:00
name: Book
on:
push:
branches:
- master
pull_request:
paths:
- 'book/**'
2021-05-16 07:58:26 +00:00
- '.github/workflows/book.yml'
2020-06-24 18:22:51 +00:00
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
2021-05-16 07:58:26 +00:00
MDBOOK_VERSION: '0.4.8'
MDBOOK_LINKCHECK_VERSION: '0.7.4'
MDBOOK_MERMAID_VERSION: '0.8.1'
2020-06-24 18:22:51 +00:00
steps:
- uses: actions/checkout@v2
- name: Install mdbook
run: |
2021-05-16 07:58:26 +00:00
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 ~/.cargo/bin
curl -L https://github.com/badboy/mdbook-mermaid/releases/download/v$MDBOOK_MERMAID_VERSION/mdbook-mermaid-v$MDBOOK_MERMAID_VERSION-x86_64-unknown-linux-gnu.tar.gz | tar xz -C ~/.cargo/bin
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.zip -O
unzip mdbook-linkcheck.v$MDBOOK_LINKCHECK_VERSION.x86_64-unknown-linux-gnu.zip -d ~/.cargo/bin
chmod +x ~/.cargo/bin/mdbook-linkcheck
2020-06-24 18:22:51 +00:00
- 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: .