-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (52 loc) · 2.01 KB
/
Copy pathdocs.yml
File metadata and controls
52 lines (52 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Docs
# Builds the documentation site (site/build.sh) and publishes it to GitHub
# Pages when a release tag is pushed, so the site describes the released
# binary. Pull requests that touch what the site is made from only build it,
# so a broken page or include fails before it merges; a manual run publishes
# the ref it runs on.
on:
push:
tags: ["v*"]
pull_request:
paths: ["site/**", "README.md", "CHANGELOG.md", "docs/classification-cascade.md", "jevgate.schema.json", ".github/workflows/docs.yml"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
env:
MDBOOK_VERSION: 0.5.4
MDBOOK_SHA256: 5222beabd3e37dc5be0d18ff99b79058469354db5c220153a1b92db5ba12be89
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust
run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- name: Install mdBook
run: |
archive="mdbook-v$MDBOOK_VERSION-x86_64-unknown-linux-musl.tar.gz"
curl -fsSL -o "$RUNNER_TEMP/$archive" "https://github.com/rust-lang/mdBook/releases/download/v$MDBOOK_VERSION/$archive"
echo "$MDBOOK_SHA256 $RUNNER_TEMP/$archive" | sha256sum -c -
mkdir -p "$RUNNER_TEMP/bin" && tar -xzf "$RUNNER_TEMP/$archive" -C "$RUNNER_TEMP/bin"
echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"
- run: site/build.sh
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site/book
deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1