From 24c86ade4fe21936ce1ee2a4c9cdf73ed7418d80 Mon Sep 17 00:00:00 2001 From: Julian Hofer Date: Fri, 29 Sep 2023 19:47:13 +0200 Subject: [PATCH] book: Run separate jobs for check and deploy We don't want deployment to fail because of a broken link --- .github/workflows/book.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index aa4f508cedde..cc5b222a4532 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -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/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