Update structure for miden-book
#851
Workflow file for this run
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
# Performs checks, builds and deploys the documentation mdbook. | |
# | |
# Flow is based on the official github and mdbook documentation: | |
# | |
# https://github.com/actions/starter-workflows/blob/main/pages/mdbook.yml | |
# https://github.com/rust-lang/mdBook/wiki/Automated-Deployment%3A-GitHub-Actions | |
name: book | |
# Documentation should be built and tested on every pull-request, and additionally deployed on push onto next. | |
on: | |
workflow_dispatch: | |
pull_request: | |
path: ['docs/**'] | |
push: | |
branches: [next] | |
path: ['docs/**'] | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Always build and test the mdbook documentation whenever the docs folder is changed. | |
# | |
# The documentation is uploaded as a github artifact IFF it is required for deployment i.e. on push into next. | |
build: | |
name: Build documentation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
# Installation from source takes a fair while, so we install the binaries directly instead. | |
- name: Install mdbook and plugins | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: mdbook, mdbook-linkcheck, mdbook-alerts, mdbook-katex | |
- name: Build book | |
run: mdbook build docs/ | |
# Only Upload documentation if we want to deploy (i.e. push to next). | |
- name: Setup Pages | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/next' }} | |
id: pages | |
uses: actions/configure-pages@v5 | |
- name: Upload book artifact | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/next' }} | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# We specify multiple [output] sections in our book.toml which causes mdbook to create separate folders for each. This moves the generated `html` into its own `html` subdirectory. | |
path: ./docs/book/html | |
# Deployment job only runs on push to next. | |
deploy: | |
name: Deploy documentation | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/next' }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |