diff --git a/.github/workflows/book-deploy.yml b/.github/workflows/book-deploy.yml new file mode 100644 index 000000000000..3496f7c7ef04 --- /dev/null +++ b/.github/workflows/book-deploy.yml @@ -0,0 +1,34 @@ +name: book + +on: + push: + branches: + - "master" + paths: + - "book/**" + +jobs: + deploy: + runs-on: ubuntu-22.04 + name: build + 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 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book/public + keep_files: false + destination_dir: stable/latest/book diff --git a/.github/workflows/book-lint.yml b/.github/workflows/book-lint.yml new file mode 100644 index 000000000000..ffffc9208cba --- /dev/null +++ b/.github/workflows/book-lint.yml @@ -0,0 +1,30 @@ +name: book + +on: + pull_request: + paths: + - "book/**" + +jobs: + check: + runs-on: ubuntu-22.04 + name: build + 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: Link Checker + uses: lycheeverse/lychee-action@v1.8.0 + with: + args: book/public + fail: true diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml deleted file mode 100644 index cc5b222a4532..000000000000 --- a/.github/workflows/book.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: book - -on: - pull_request: - paths: - - "book/**" - push: - branches: - - "master" - paths: - - "book/**" - -jobs: - check: - runs-on: ubuntu-22.04 - name: build - if: ${{ github.event_name == 'pull_request' }} - 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: 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 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./book/public - keep_files: false - destination_dir: stable/latest/book