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    steps:
27      - uses: actions/checkout@v4
28      - name: Install mdBook
29        run: |
30          curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
31          rustup update
32          cargo install --version ${MDBOOK_VERSION} mdbook          
33      - name: Setup Pages
34        id: pages
35        uses: actions/configure-pages@v4
36      - name: Build with mdBook
37        run: mdbook build
38      - name: Upload artifact
39        uses: actions/upload-pages-artifact@v3
40        with:
41          path: ./book
42
43  deploy:
44    environment:
45      name: github-pages
46      url: ${{ steps.deployment.outputs.page_url }}
47    runs-on: ubuntu-latest
48    needs: build
49    steps:
50      - name: Deploy to GitHub Pages
51        id: deployment
52        uses: actions/deploy-pages@v4