Skip to content

fix: gqm build error #49

fix: gqm build error

fix: gqm build error #49

Workflow file for this run

# Workflow for building and deploying a mdBook site to GitHub Pages.
# - On push to main: deploys to the root of gh-pages.
# - On pull_request: deploys a preview under pr-preview/pr-<number>/ on gh-pages,
# comments the preview URL, and cleans up when the PR closes.
#
# Repo Settings required:
# Pages -> Source: "Deploy from a branch" -> gh-pages / (root)
# Actions -> General -> Workflow permissions: "Read and write permissions"
#
# See: https://rust-lang.github.io/mdBook/index.html
name: Deploy mdBook site to Pages
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened, closed]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
deploy:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
concurrency:
group: pages
cancel-in-progress: false
env:
CARGO_HOME: ${{ github.workspace }}/.cargo
RUSTUP_HOME: ${{ github.workspace }}/.rustup
steps:
- uses: actions/checkout@v4
- name: Cache Cargo registry and git index
uses: actions/cache@v4
with:
path: |
${{ env.CARGO_HOME }}/registry
${{ env.CARGO_HOME }}/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('scripts/install-mdbook.sh') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
# Cache full RUSTUP_HOME (rustc + toolchain + settings) so rustup does minimal work on restore.
- name: Cache Rust toolchain (rustc)
uses: actions/cache@v4
with:
path: ${{ env.RUSTUP_HOME }}
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('scripts/install-mdbook.sh') }}
restore-keys: |
${{ runner.os }}-rust-toolchain-
# Exact key only (no restore-keys) so we never restore a bin/ missing a tool (e.g. linkcheck2).
- name: Cache installed mdBook binaries
id: mdbook-cache
uses: actions/cache@v4
with:
path: |
${{ env.CARGO_HOME }}/bin
key: ${{ runner.os }}-mdbook-bin-${{ hashFiles('scripts/install-mdbook.sh') }}
# Script skips install when cached binaries already match versions in install-mdbook.sh
- name: Install mdBook
run: bash scripts/install-mdbook.sh
env:
REPO_ROOT: ${{ github.workspace }}
- name: Add Cargo bin to PATH
run: echo "${CARGO_HOME}/bin" >> "$GITHUB_PATH"
- name: Build with mdBook
run: ${{ env.CARGO_HOME }}/bin/mdbook build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book
keep_files: true
preview:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
concurrency: preview-${{ github.ref }}
env:
CARGO_HOME: ${{ github.workspace }}/.cargo
RUSTUP_HOME: ${{ github.workspace }}/.rustup
steps:
- uses: actions/checkout@v4
- name: Cache Cargo registry and git index
if: github.event.action != 'closed'
uses: actions/cache@v4
with:
path: |
${{ env.CARGO_HOME }}/registry
${{ env.CARGO_HOME }}/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('scripts/install-mdbook.sh') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
# Cache full RUSTUP_HOME (rustc + toolchain + settings) so rustup does minimal work on restore.
- name: Cache Rust toolchain (rustc)
if: github.event.action != 'closed'
uses: actions/cache@v4
with:
path: ${{ env.RUSTUP_HOME }}
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('scripts/install-mdbook.sh') }}
restore-keys: |
${{ runner.os }}-rust-toolchain-
# Exact key only (no restore-keys) so we never restore a bin/ missing a tool (e.g. linkcheck2).
- name: Cache installed mdBook binaries
if: github.event.action != 'closed'
id: mdbook-cache
uses: actions/cache@v4
with:
path: |
${{ env.CARGO_HOME }}/bin
key: ${{ runner.os }}-mdbook-bin-${{ hashFiles('scripts/install-mdbook.sh') }}
# Script skips install when cached binaries already match versions in install-mdbook.sh
- name: Install mdBook
if: github.event.action != 'closed'
run: bash scripts/install-mdbook.sh
env:
REPO_ROOT: ${{ github.workspace }}
- name: Add Cargo bin to PATH
if: github.event.action != 'closed'
run: echo "${CARGO_HOME}/bin" >> "$GITHUB_PATH"
- name: Build with mdBook
if: github.event.action != 'closed'
run: ${{ env.CARGO_HOME }}/bin/mdbook build
- name: Deploy PR preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./book
preview-branch: gh-pages
umbrella-dir: pr-preview