Skip to content

Commit 88ec98b

Browse files
authoredJun 29, 2024··
Automatically build mdbook and deploy to pages
1 parent 9cd74f5 commit 88ec98b

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
 

‎.github/workflows/mdbook.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Sample workflow for building and deploying a mdBook site to GitHub Pages
2+
#
3+
# To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html
4+
#
5+
name: Deploy mdBook site to Pages
6+
7+
on:
8+
# Runs on pushes targeting the default branch
9+
push:
10+
branches: ["master"]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: "pages"
25+
cancel-in-progress: false
26+
27+
jobs:
28+
# Build job
29+
build:
30+
runs-on: ubuntu-latest
31+
env:
32+
MDBOOK_VERSION: 0.4.40
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Install mdBook
36+
run: |
37+
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
38+
rustup update
39+
cargo install --version ${MDBOOK_VERSION} mdbook
40+
- name: Setup Pages
41+
id: pages
42+
uses: actions/configure-pages@v5
43+
- name: Build with mdBook
44+
run: mdbook build -d ./dist/book
45+
- name: Copy roller
46+
run: cp -r roller/ ./dist
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: ./dist
51+
52+
# Deployment job
53+
deploy:
54+
environment:
55+
name: github-pages
56+
url: ${{ steps.deployment.outputs.page_url }}
57+
runs-on: ubuntu-latest
58+
needs: build
59+
steps:
60+
- name: Deploy to GitHub Pages
61+
id: deployment
62+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)
Please sign in to comment.