DS553 / .github /workflows /huggingface-sync.yml
Krish Shah-Nathwani
Add GitHub Action for Hugging Face sync
2193025
raw
history blame contribute delete
808 Bytes
name: Sync to Hugging Face Space
on:
push:
branches:
- main # Triggers on push to the 'main' branch
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
sync:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v2
# Step 2: Install huggingface-cli
- name: Install Hugging Face CLI
run: pip install huggingface-hub
# Step 3: Log in to Hugging Face using the API token
- name: Hugging Face Login
run: huggingface-cli login --token ${{ secrets.HF_TOKEN }}
# Step 4: Sync to Hugging Face Space
- name: Sync with Hugging Face Space
run: |
git push https://huggingface.co/${{ secrets.HF_USERNAME }}/DS553.git main