update sync #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync Space | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Login with Huggingface CLI | |
run: | | |
pip install -U "huggingface_hub[cli]" hf-transfer | |
git config --global credential.helper store | |
huggingface-cli login --token ${{ secrets.HF_TOKEN }} | |
- name: Upload Files | |
env: | |
HF_HUB_ENABLE_HF_TRANSFER: 1 | |
run: | | |
files=$(git diff --name-only HEAD HEAD~1) | |
for file in "$files"; do | |
huggingface-cli upload --repo-type space TotalSundae/dungeons-and-dragons $file $file | |
done |