Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Preview

on:
pull_request:
types: [opened, synchronize, reopened, closed]

concurrency: preview-${{ github.ref }}

jobs:
preview:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Checkout mdbook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: "latest"
- name: Build mdbook
run: mdbook build --dest-dir out

- name: Cache Cargo registry and Cargo bin
id: cargo-cache
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock','**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Install mdbook-utils
if: steps.cargo-cache.outputs.cache-hit != 'true'
run: cargo install mdbook-utils

- name: Generate sitemap
run: mdbook-utils sitemap -o out/sitemap.xml -b https://rsdocsjp.org/ -y

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./out/
Comment thread
hinshiba marked this conversation as resolved.
Outdated