Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

book: Run separate jobs for check and deploy #1501

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/lychee-action@v1.8.0
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