Merge pull request #953 from omertuc/cli #610
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy docs to pages | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
# To build the docs locally you can also do e.g.: | |
# cargo install mdbook-mermaid | |
# cd docs | |
# mdbook-mermaid install | |
# mdbook serve | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MDBOOK_VERSION: 0.4.37 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install mdBook | |
run: | | |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name') | |
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz" | |
mkdir mdbook | |
curl -sSL $url | tar -xz --directory=./mdbook | |
echo `pwd`/mdbook >> $GITHUB_PATH | |
- name: Install mdbook-mermaid | |
run: | | |
tag=$(curl 'https://api.github.com/repos/badboy/mdbook-mermaid/releases/latest' | jq -r '.tag_name') | |
url="https://github.com/badboy/mdbook-mermaid/releases/download/${tag}/mdbook-mermaid-${tag}-x86_64-unknown-linux-gnu.tar.gz" | |
mkdir mdbook-mermaid | |
curl -sSL $url | tar -xz --directory=./mdbook-mermaid | |
echo `pwd`/mdbook-mermaid >> $GITHUB_PATH | |
- name: Install mdbook-linkcheck | |
run: | | |
tag=$(curl 'https://api.github.com/repos/Michael-F-Bryan/mdbook-linkcheck/releases/latest' | jq -r '.tag_name') | |
archive="mdbook-linkcheck.x86_64-unknown-linux-gnu.zip" | |
url="https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/${tag}/${archive}" | |
mkdir mdbook-linkcheck | |
curl -sSL -O $url && unzip ${archive} -d ./mdbook-linkcheck && chmod +x ./mdbook-linkcheck/mdbook-linkcheck | |
echo `pwd`/mdbook-linkcheck >> $GITHUB_PATH | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v5 | |
- name: Build with mdBook | |
run: cd docs && mdbook-mermaid install && mdbook build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./docs/book/html | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |