Skip to content

Commit

Permalink
book: Run separate jobs for check and deploy
Browse files Browse the repository at this point in the history
We don't want deployment to fail because of a broken link
  • Loading branch information
Hofer-Julian authored and bilelmoussaoui committed Sep 29, 2023
1 parent eabd494 commit 24c86ad
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ on:
- "book/**"

jobs:
build-deploy:
check:
runs-on: ubuntu-22.04
name: build
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
Expand All @@ -27,16 +28,33 @@ jobs:

- run: mdbook build -d public
working-directory: book

- name: Link Checker
uses: lycheeverse/[email protected]
with:
args: book/public
fail: true

build-deploy:
runs-on: ubuntu-22.04
name: build
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1

- run: mdbook build -d public
working-directory: book

- name: Deploy to stable
uses: peaceiris/actions-gh-pages@v3
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/public
Expand Down

0 comments on commit 24c86ad

Please sign in to comment.