Skip to content

Commit 24c86ad

Browse files
Hofer-Julianbilelmoussaoui
authored andcommitted
book: Run separate jobs for check and deploy
We don't want deployment to fail because of a broken link
1 parent eabd494 commit 24c86ad

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/book.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ on:
1111
- "book/**"
1212

1313
jobs:
14-
build-deploy:
14+
check:
1515
runs-on: ubuntu-22.04
1616
name: build
17+
if: ${{ github.event_name == 'pull_request' }}
1718
steps:
1819
- uses: actions/checkout@v4
1920
- uses: actions-rs/toolchain@v1
@@ -27,16 +28,33 @@ jobs:
2728

2829
- run: mdbook build -d public
2930
working-directory: book
30-
31+
3132
- name: Link Checker
3233
uses: lycheeverse/[email protected]
3334
with:
3435
args: book/public
3536
fail: true
3637

38+
build-deploy:
39+
runs-on: ubuntu-22.04
40+
name: build
41+
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' }}
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: actions-rs/toolchain@v1
45+
with:
46+
profile: minimal
47+
toolchain: stable
48+
override: true
49+
50+
- name: Setup mdBook
51+
uses: peaceiris/actions-mdbook@v1
52+
53+
- run: mdbook build -d public
54+
working-directory: book
55+
3756
- name: Deploy to stable
3857
uses: peaceiris/actions-gh-pages@v3
39-
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' }}
4058
with:
4159
github_token: ${{ secrets.GITHUB_TOKEN }}
4260
publish_dir: ./book/public

0 commit comments

Comments
 (0)