Skip to content

A GitHub Action that syncs your repository to Hugging Face Hub πŸ€—

License

Notifications You must be signed in to change notification settings

huggingface/hub-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

hub-sync action

A GitHub Action that syncs your repository to Hugging Face Hub πŸ€—

Uses the official HF CLI via uvx for fast, reliable deployments to Spaces, Models, or Datasets.

Quick Start

Add your HF token as a GitHub secret (HF_TOKEN), then:

name: Sync to Hugging Face
on:
  push:
    branches: [main]

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: huggingface/hub-sync@main
        with:
          github_repo_id: ${{ github.repository }}
          huggingface_repo_id: username/repo-name
          hf_token: ${{ secrets.HF_TOKEN }}

Usage

All Options

- uses: huggingface/hub-sync@main
  with:
    # Required
    github_repo_id: ${{ github.repository }}
    huggingface_repo_id: username/repo-name
    hf_token: ${{ secrets.HF_TOKEN }}
    
    # Optional
    repo_type: space              # space | model | dataset (default: space)
    space_sdk: gradio             # gradio | streamlit | docker | static (default: gradio)
    private: false                # Create as private (default: false)
    subdirectory: ''              # Sync only this folder (default: '' = root)

Features

  • Automatic exclusions β€” .github/ and .git/ filtered via --exclude
  • True mirroring β€” deletes removed files from HF using --delete="*"
  • Subdirectory support β€” perfect for monorepos
  • Custom commit messages β€” synced commits say "Sync from GitHub via hub-sync"

About

A GitHub Action that syncs your repository to Hugging Face Hub πŸ€—

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •