termflix 0.6.0

Terminal animation player with 44 procedurally generated animations, multiple render modes, and true color support
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: [main]
    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