Files
cube/.gitea/workflows/deploy-video2slides.yml
fam 4ee9b6ce78 video2slides: 新 app — 长视频抽帧 + 逐帧差异 + 拖阈值挑幻灯片
Rust + axum + cube-core,前端纯静态单页。ffmpeg 每 N 秒抽一帧(限宽
1280),image crate 逐帧灰度 MAE 算差异;前端拖阈值实时把相近帧变灰、
关键变化高亮,悬停出彩色大图,分页 + toolbar 常驻。按 X-Client-Id 分目录
隔离,存储走 hostPath。镜像非 scratch:debian-slim + ffmpeg + musl binary。
2026-06-14 21:29:47 +01:00

53 lines
1.8 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: deploy video2slides
# video2slides.famzheng.me — 长视频抽帧,逐帧差异比较,拖阈值挑关键画面/幻灯片。
# host shell runner(fam 用户)。镜像非 scratch:debian-slim + ffmpeg + 静态 musl binary。
on:
push:
branches: [master]
paths:
- 'apps/video2slides/**'
- 'crates/cube-core/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.gitea/workflows/deploy-video2slides.yml'
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
APP: video2slides
IMAGE: registry.famzheng.me/mochi/video2slides
steps:
- uses: actions/checkout@v4
- name: Resolve image tag
id: tag
run: |
echo "sha=$(git rev-parse --short=12 HEAD)" >> "$GITHUB_OUTPUT"
- name: Build rust (musl static)
run: |
export PATH="$HOME/.cargo/bin:$PATH"
cargo build --release --target x86_64-unknown-linux-musl -p "$APP"
- name: Build & push image
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
echo "$REGISTRY_TOKEN" | docker login registry.famzheng.me -u mochi --password-stdin
# COPY binary 这层必须 --no-cache,否则 docker layer cache 会套用历史 binary
# (cube 平台踩过的坑)。
docker build --no-cache -f "apps/$APP/Dockerfile" -t "$IMAGE:${{ steps.tag.outputs.sha }}" .
docker push "$IMAGE:${{ steps.tag.outputs.sha }}"
- name: Initialize K8s resources
run: |
kubectl apply -f "apps/$APP/k8s/all.yaml"
- name: Roll out to k3s
run: |
kubectl -n "cube-$APP" set image "deploy/$APP" "$APP=$IMAGE:${{ steps.tag.outputs.sha }}"
kubectl -n "cube-$APP" rollout status "deploy/$APP" --timeout=120s