Skip to content

Commit 3a8c163

Browse files
committed
Add mdbook GitHub Actions.
1 parent 627592a commit 3a8c163

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.github/workflows/mdbook.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: mdbook
2+
on:
3+
push:
4+
paths:
5+
- "src/**.md"
6+
- "book.toml"
7+
8+
pull_request:
9+
branches:
10+
- main
11+
paths:
12+
- "src/**.md"
13+
- "book.toml"
14+
15+
jobs:
16+
pages:
17+
name: GitHub Pages
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Setup mdBook 📔
23+
uses: peaceiris/actions-mdbook@v1
24+
with:
25+
mdbook-version: '0.4.10'
26+
# mdbook-version: 'latest'
27+
28+
- run: mdbook build
29+
30+
- name: Deploy 🚀
31+
uses: peaceiris/actions-gh-pages@v3
32+
if: github.event_name == 'push' && github.repository == 'fortran-fans/modern-fortran-programming' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/main' )
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: ./book

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 现代Fortran程序设计
22

3+
[![Actions Status](https://github.com/fortran-fans/modern-fortran-programming/workflows/mdbook/badge.svg)](https://github.com/fortran-fans/modern-fortran-programming/actions)
4+
35
Modern Fortran Programming
46

57

book.toml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ src = "src"
88

99
[output.html]
1010
mathjax-support = true
11+
git-repository-url = "https://github.com/fortran-fans/modern-fortran-programming/tree/main/"
12+
edit-url-template = "https://github.com/fortran-fans/modern-fortran-programming/edit/main/{path}"
1113

1214
[output.html.playground]
1315
editable = false

0 commit comments

Comments
 (0)