跳到正文
FunCoding

deploy-hf

Release a new imcui version and deploy to HuggingFace Spaces (test → prod). Invoke when user asks to release, deploy, or ship a new version.

Star
1,309
许可证
Apache-2.0
最近提交
2026年10月6日

.claude/skills/deploy-hf/SKILL.md

在 GitHub 上查看

Deploy to HuggingFace Spaces

This skill handles the full release pipeline: version bump → tag → release → deploy to HF test → deploy to HF prod.

Prerequisites

  • Working inside image-matching-webui project root
  • Authenticated with GitHub (gh) and HuggingFace (hf)
  • HF git credential configured (see branch setup below)

Branch Setup (one-time)

# Add HF remotes (only needed once)
git remote add hf-test https://huggingface.co/spaces/Realcat/imcui
git remote add hf-prod https://huggingface.co/spaces/Realcat/image-matching-webui

# Configure git credential for HF
git config --global credential.https://huggingface.co.username Realcat

Release & Deploy Workflow

Step 1: Release new version on GitHub

# On main branch
# 1. Bump version in pyproject.toml
# 2. Add any new deps to requirements.txt
# 3. Commit
git add pyproject.toml requirements.txt
git commit -m "chore: bump version to X.Y.Z"
git push origin main

# 4. Tag and release
git tag -a vX.Y.Z -m "vX.Y.Z: <description>"
git push origin vX.Y.Z
gh release create vX.Y.Z --title "vX.Y.Z" --notes "..."

This triggers two CI workflows:

  • docker-publish.yml (on tag v*) → Docker Hub image
  • release.yml (on release published) → PyPI whl

Step 2: Update huggingface branch

git checkout huggingface
# Update requirements.txt: imcui==X.Y.Z
git add requirements.txt
git commit -m "chore: bump imcui to X.Y.Z"
git push origin huggingface

Step 3: Deploy to test Space

Wait for PyPI release to complete (~10 min), then:

git push hf-test huggingface:main --force

Verify at https://huggingface.co/spaces/Realcat/imcui

Step 4: Deploy to production Space

After confirming test Space works:

git push hf-prod huggingface:main --force

HuggingFace Space Configuration

The huggingface branch is a lightweight orphan branch containing only deployment files:

FilePurpose
app.pyLauncher importing from imcui package
requirements.txtimcui==X.Y.Z (pulls all deps from PyPI)
packages.txtSystem deps: build-essential, ffmpeg, libsm6, libxext6
config/app.yamlFull matcher zoo config
README.mdHF metadata: sdk: gradio, python_version: "3.12", pinned: true

ZeroGPU requires Gradio SDK (not Docker). Python pinned to 3.12 because imcui does not support 3.13 yet.

Sync config from main

When main's imcui/config/app.yaml changes (new matchers added), sync to huggingface branch:

git checkout huggingface
cp imcui/config/app.yaml config/app.yaml
git add config/app.yaml
git commit -m "chore: sync config from main"
git push origin huggingface

相似的 Skill

官方

internal-comms

ANanthropics/skills181k近 7 天新增 1,119 个 star

canary

GAgarrytan/gstack136k近 7 天新增 883 个 star

observability-and-instrumentation

ADaddyosmani/agent-skills106k近 7 天新增 3,628 个 star

精选

shipping-and-launch

上线前逐项检查,规划监控、分阶段发布和回滚方案。

ADaddyosmani/agent-skills106k近 7 天新增 3,628 个 star

paperclip-board

PApaperclipai/paperclip101k近 7 天新增 2,948 个 star

ruview-configure

RUruvnet/RuView98k近 7 天新增 968 个 star