Skip to content

merge

merge #596

Workflow file for this run

name: Generate User Manual
on:
release:
types: [ published ]
push:
branches: [master]
paths-ignore: [ 'README.md' ]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine current mdbook version
id: mdbook-version
uses: pozetroninc/github-action-get-latest-release@06da55dc399d06375d2d1fe57542398d5bd989c6
with:
owner: rust-lang
repo: mdBook
excludes: prerelease, draft
- name: Cache mdbook
id: cache-mdbook
uses: actions/cache@v3
with:
path: ~/.cargo/bin/mdbook
key: ${{ runner.os }}-mdbook-${{ steps.mdbook-version.outputs.release }}
- name: Install mdbook
if: steps.cache-mdbook.outputs.cache-hit != 'true'
run: |
curl --proto '=https' --tlsv1.2 -sSf https://rossmacarthur.github.io/install/crate.sh | bash -s -- --repo "rust-lang/mdBook" --bin mdbook --to ~/.cargo/bin
- name: Determine current mdbook-toc version
id: mdbook-toc-version
uses: pozetroninc/github-action-get-latest-release@06da55dc399d06375d2d1fe57542398d5bd989c6
with:
owner: badboy
repo: mdbook-toc
excludes: prerelease, draft
- name: Cache mdbook-toc
id: cache-mdbook-toc
uses: actions/cache@v3
with:
path: ~/.cargo/bin/mdbook-toc
key: ${{ runner.os }}-mdbook-toc-${{ steps.mdbook-toc-version.outputs.release }}
- name: Install mdbook-toc
if: steps.cache-mdbook-toc.outputs.cache-hit != 'true'
run: |
curl --proto '=https' --tlsv1.2 -sSf https://rossmacarthur.github.io/install/crate.sh | bash -s -- --repo "badboy/mdbook-toc" --to ~/.cargo/bin
- name: Substituting KWEB_VERSION
run: |
cd docs
V=$(curl --silent "https://api.github.com/repos/kwebio/kweb-core/releases" | jq -r '.[0].tag_name')
echo "Substituting version $V"
sed -i "s/KWEB_VERSION/$V/g" src/gettingstarted.md
- name: Build MDBook
run: |
mdbook --version
mdbook-toc --version
cd docs
mdbook build
- name: Validate hyperlinks
uses: untitaker/hyperlink@0.1.26
with:
args: docs/book --sources src/
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/book
target-folder: book