GitHub Actions for mdBook

I published the GitHub Actions for mdBook.

We can run mdBook on a virtual machine of GitHub Actions with this setup action. Linux, macOS, and Windows are supported.

Here is an example workflow to deploy to the GitHub Pages.

name: github pages

on:
  push:
    branches:
    - master

jobs:
  build-deploy:
    runs-on: ubuntu-18.04
    steps:
    - uses: actions/checkout@v2

    - name: Setup mdBook
      uses: peaceiris/actions-mdbook@v1
      with:
        mdbook-version: '0.3.5'

    - run: mdbook build

    - name: Deploy
      uses: peaceiris/actions-gh-pages@v2
      env:
        ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
        PUBLISH_BRANCH: gh-pages
        PUBLISH_DIR: ./book

Fetch the latest version of mdBook.

- name: Setup mdBook
  uses: peaceiris/actions-mdbook@v1
  with:
    mdbook-version: 'latest'
3 Likes

Here is the new workflow with peaceiris/actions-gh-pages v3.

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
          publish_dir: ./book

This GitHub Pages Deploy Action has been migrated to a TypeScript Action. Your job will complete faster than v2.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.