arnaucube
arnaucube/sonobe-docsPublic Self-hosted repository
sonobe-docs/.github/workflows/mdbook.yml
.github/workflows/mdbook.ymlRaw
 1name: Publish mdbook
 2on:
 3  push:
 4    branches: ["main"]
 5
 6  # Allows to run this workflow manually from the Actions tab
 7  workflow_dispatch:
 8
 9# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10permissions:
11  contents: read
12  pages: write
13  id-token: write
14
15# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17concurrency:
18  group: "pages"
19  cancel-in-progress: false
20
21jobs:
22  build:
23    runs-on: ubuntu-latest
24    env:
25      MDBOOK_VERSION: 0.4.36
26      MDBOOKKATEX_VERSION: 0.7.0
27    steps:
28      - uses: actions/checkout@v4
29      - name: Install mdBook
30        run: |
31          curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
32          rustup update
33          cargo install --version ${MDBOOK_VERSION} mdbook
34          cargo install --version ${MDBOOKKATEX_VERSION} mdbook-katex          
35      - name: Setup Pages
36        id: pages
37        uses: actions/configure-pages@v4
38      - name: Build with mdBook
39        run: mdbook build
40      - name: Upload artifact
41        uses: actions/upload-pages-artifact@v3
42        with:
43          path: ./book
44
45  deploy:
46    environment:
47      name: github-pages
48      url: ${{ steps.deployment.outputs.page_url }}
49    runs-on: ubuntu-latest
50    needs: build
51    steps:
52      - name: Deploy to GitHub Pages
53        id: deployment
54        uses: actions/deploy-pages@v4