Skip to content

deploy book via official actions #794

deploy book via official actions

deploy book via official actions #794

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- master
jobs:
test:
name: build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install mdbook
run: |
tag=$(curl -LsSf https://api.github.com/repos/rust-lang/mdBook/releases/latest | jq -r '.tag_name')
curl -LsSf https://github.com/rust-lang/mdBook/releases/download/$tag/mdbook-$tag-x86_64-unknown-linux-gnu.tar.gz | tar xzf -
tag=$(curl -LsSf https://api.github.com/repos/badboy/mdbook-mermaid/releases/latest | jq -r '.tag_name')
curl -LsSf https://github.com/badboy/mdbook-mermaid/releases/download/$tag/mdbook-mermaid-$tag-x86_64-unknown-linux-gnu.tar.gz | tar xzf -
echo $(pwd) >> $GITHUB_PATH
- run: mdbook build
- name: Configure git
run: |
git config --global http.postBuffer 50000000
git config --global https.postBuffer 50000000
- name: Upload book artifacts
uses: actions/upload-pages-artifact@v3
with:
path: book
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'rust-lang'
# Deploy is run as a separate job as it needs elevated permissions
deploy:
name: deploy
runs-on: ubuntu-latest
needs: test # the `test` job uploads the pages artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'rust-lang'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
id: deployment