-
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
book: Run separate jobs for check and deploy
We don't want deployment to fail because of a broken link
- Loading branch information
1 parent
eabd494
commit 24c86ad
Showing
1 changed file
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|