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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Gallery
# Builds the PNG+GIF gallery and deploys it to GitHub Pages.
#
# REPO SETUP: `actions/configure-pages` is invoked with
# `enablement: true`, so the workflow will auto-enable Pages on the
# first run (provided the repo's Settings → Pages allows
# "GitHub Actions" as a source — which is the default).
on:
push:
branches:
paths:
- "src/**"
- "Cargo.toml"
- "Cargo.lock"
- "Makefile"
- ".github/workflows/gallery.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# One in-flight gallery deploy at a time; don't cancel a running one
# (it's the live site).
concurrency:
group: pages
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.93.1"
jobs:
build:
name: Build gallery
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache target directory
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-release-${{ hashFiles('**/Cargo.lock') }}
- name: Generate gallery
run: make gallery
- name: Configure Pages
uses: actions/configure-pages@v5
with:
enablement: true
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./gallery
deploy:
name: Deploy to Pages
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4