Rust-Actions mdbook: actions-mdbook — GitHub Actions for mdBook

license release GitHub release date Test CodeFactor codecov Release Feed

GitHub Actions for mdBook

GitHub Actions for mdBook

rust-lang/mdBook Setup Action.

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

OS (runs-on) ubuntu-18.04 macos-latest windows-2019
Support ✅️ ✅️ ✅️

Table of Contents

Getting Started

⭐️ Create your workflow

An example workflow .github/workflows/gh-pages.yml with GitHub Actions for GitHub Pages. For the first deployment, we have to do this operation: First Deployment with GITHUB_TOKEN - peaceiris/actions-gh-pages

peaceiris/actions-gh-pages - GitHub

name: github pages

on:
  push:
    branches:
      - master

jobs:
  deploy:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/[email protected]

      - name: Setup mdBook
        uses: peaceiris/[email protected]
        with:
          mdbook-version: '0.3.7'
          # mdbook-version: 'latest'

      - run: mdbook build

      - name: Deploy
        uses: peaceiris/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./book

Options

⭐️ Use the latest version of mdBook

Set mdbook-version: 'latest' to use the latest version of mdBook.

- name: Setup mdBook
  uses: peaceiris/[email protected]
  with:
    mdbook-version: 'latest'

This action fetches the latest version of mdBook by mdbook — Homebrew Formulae

Tips

⭐️ Read mdBook version from file

How to sync a mdBook version between a Docker Compose and a GitHub Actions workflow via .env file.

Write a MDBOOK_VERSION to the .env file like the following and push it to a remote branch.

MDBOOK_VERSION=0.3.7

Next, add a step to read a mdBook version from the .env file.

    - name: Read .env
      id: mdbook-version
      run: |
        . ./.env
        echo "::set-output name=MDBOOK_VERSION::${MDBOOK_VERSION}"

    - name: Setup mdBook
      uses: peaceiris/[email protected]
      with:
        mdbook-version: '${{ steps.mdbook-version.outputs.MDBOOK_VERSION }}'

Here is a docker-compose.yml example.

version: '3'

services:
  mdbook:
    container_name: mdbook
    image: "peaceiris/mdbook:v${MDBOOK_VERSION}"
    # image: "peaceiris/mdbook:v${MDBOOK_VERSION}-rust"  # Large image including Rust compiler
    stdin_open: true
    tty: true
    ports:
      - 3000:3000
      - 3001:3001
    volumes:
      - ${PWD}:/book
    command:
      - serve
      - --hostname
      - '0.0.0.0'

The alpine base mdBook Docker image is provided on the following repository.

peaceiris/docker-mdbook: mdBook Alpine Base Docker Image.

CHANGELOG

License

About Maintainer

Maintainer Notes

Run npm and git commit commands on a container.

On Host

# Docker
make build
make run
make run cmd="env"
make test
make commit msg="chore: Add Makefile"

# Release
./release.sh

Comments

  • fix: Rename RUNNER_TEMPDIRECTORY to RUNNER_TEMP
    fix: Rename RUNNER_TEMPDIRECTORY to RUNNER_TEMP

    Jan 17, 2020

                                                                                                                                                                                                            enhancement 
    Reply
  • fix: action failure status
  • chore: Update Dockerfile
    chore: Update Dockerfile

    Jan 24, 2020

    Reply
  • refactor: Add readonly
    refactor: Add readonly

    Jan 26, 2020

                                                                                                                                                                                                            enhancement 
    Reply
  • fix: api.github tag_name
    fix: api.github tag_name

    Jan 26, 2020

    • Add replace('v', '')
    • Add test
    enhancement 
    Reply
  • chore: Add engines field
    chore: Add engines field

    Jan 28, 2020

    https://github.com/peaceiris/actions-hugo/commit/aeba6547bbb28e39b29e7d03f6978c80d6c09931

    enhancement 
    Reply
  • Bug: Couldn't open SUMMARY.md
    Bug: Couldn't open SUMMARY.md

    Jan 8, 2020

    Describe the bug Explicitly setting mdbook build path and instead resulting in the following error:

    [ERROR] (mdbook::utils): Error: Couldn't open SUMMARY.md
    [ERROR] (mdbook::utils): 	Caused By: No such file or directory (os error 2)
    

    To Reproduce Simply running the GitHub workflow

    Expected behavior mdbook build to run and complete.

    Screenshots If applicable, add screenshots to help explain your problem.

    Your YAML file nurodev/atlas/blob/master/.github/workflows/book.yml

    Additional context I have also done a sanity check and logged the current working directory when the step is run and it clearly shows that the book contents is present and ready to be build:

    /home/runner/work/atlas/atlas/book
    book.toml
    custom.css
    now.json
    src
    2020-01-08 16:54:46 [ERROR] (mdbook::utils): Error: Couldn't open SUMMARY.md
    2020-01-08 16:54:46 [ERROR] (mdbook::utils): 	Caused By: No such file or directory (os error 2)
    ##[error]Process completed with exit code 101.
    
    help wanted support 
    Reply
  • deps: bump @actions/core from 1.2.0 to 1.2.1
    deps: bump @actions/core from 1.2.0 to 1.2.1

    Jan 12, 2020

    Bumps @actions/core from 1.2.0 to 1.2.1.

    Changelog

    Sourced from @actions/core's changelog.

    @actions/core Releases

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in the .dependabot/config.yml file in this repo:

    • Update frequency
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    Reply
  • deps: bump @actions/io from 1.0.1 to 1.0.2
    deps: bump @actions/io from 1.0.1 to 1.0.2

    Jan 12, 2020

    Bumps @actions/io from 1.0.1 to 1.0.2.

    Commits
    Maintainer changes

    This version was pushed to npm by bryanmacfarlane, a new releaser for @actions/io since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in the .dependabot/config.yml file in this repo:

    • Update frequency
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    Reply
  • deps: bump @actions/exec from 1.0.2 to 1.0.3
    deps: bump @actions/exec from 1.0.2 to 1.0.3

    Jan 12, 2020

    Bumps @actions/exec from 1.0.2 to 1.0.3.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in the .dependabot/config.yml file in this repo:

    • Update frequency
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    Reply
  • deps: bump @actions/tool-cache from 1.1.2 to 1.3.0
    deps: bump @actions/tool-cache from 1.1.2 to 1.3.0

    Jan 12, 2020

    Bumps @actions/tool-cache from 1.1.2 to 1.3.0.

    Changelog

    Sourced from @actions/tool-cache's changelog.

    1.3.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in the .dependabot/config.yml file in this repo:

    • Update frequency
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    Reply
  • deps: update
    deps: update

    Jan 9, 2020

                                                                                                                                                                                                           
    Reply