Skip to content

Commit

Permalink
Add setup-mdbook.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Jun 5, 2024
1 parent 36c0f93 commit 264d285
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions setup-mdbook/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Setup mdbook
description: Install mdbook and optional mdbook plugins.

inputs:
mdbook_version:
description: 'mdbook version to install.'
required: false
default: '0.4.40'
linkcheck:
description: 'Whether to install mdbook-linkcheck.'
required: false
default: 'true'
linkcheck_version:
description: 'mdbook-linkcheck version to install.'
required: false
default: '0.7.7'
platform:
description: 'Download executables for the given platform.'
required: false
default: x86_64-unknown-linux-gnu

runs:
using: "composite"
steps:
- name: Install mdbook
run: |
mkdir -p "$HOME/.cargo/bin"
curl -sSL "https://github.com/rust-lang/mdBook/releases/download/v${{ inputs.mdbook_version }}/mdbook-v${{ inputs.mdbook_version }}-${{ inputs.platform }}.tar.gz" | tar -xvz --directory "$HOME/.cargo/bin"
shell: bash
- name: Install mdbook-linkcheck
if: ${{ inputs.linkcheck == 'true' }}
run: |
curl -sSL "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v${{ inputs.linkcheck_version }}/mdbook-linkcheck.#{{ inputs.platform }}.zip" -o mdbook-linkcheck.zip
unzip mdbook-linkcheck.zip -d "$HOME/.cargo/bin"
chmod a+x "$HOME/.cargo/bin/mdbook-linkcheck"
shell: bash

0 comments on commit 264d285

Please sign in to comment.