Skip to content

Commit f70adc9

Browse files
committed
CI: build and deploy mdBook to GitHub pages
Signed-off-by: Daniel Maslowski <info@orangecms.org>
1 parent 0edaff6 commit f70adc9

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/gh-pages.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: github pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-24.04
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up mdBook
19+
# https://github.com/jontze/action-mdbook
20+
uses: jontze/action-mdbook@v4
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
# mdbook-version: 'latest'
24+
mdbook-version: "0.4.48"
25+
26+
- name: Build
27+
run: |
28+
mdbook build
29+
mkdir pages
30+
mv book pages/
31+
32+
- name: Deploy
33+
uses: peaceiris/actions-gh-pages@v3
34+
if: ${{ github.ref == 'refs/heads/main' }}
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
publish_dir: ./pages

0 commit comments

Comments
 (0)