Skip to content

Commit 2ac8641

Browse files
Modify sync workflow to remove docs folder
Updated the workflow to remove the 'docs' folder before pushing to Hugging Face Hub.
1 parent 4d79316 commit 2ac8641

1 file changed

Lines changed: 11 additions & 20 deletions

File tree

.github/workflows/sync_to_hf.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
1-
name: Sync to Hugging Face Hub
2-
3-
on:
4-
push:
5-
branches: [main]
6-
# Allows you to run this workflow manually from the Actions tab
7-
workflow_dispatch:
8-
9-
jobs:
10-
sync-to-hub:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Checkout Code
14-
uses: actions/checkout@v4
15-
with:
16-
fetch-depth: 0
17-
lfs: true
18-
19-
- name: Push to Hub
1+
- name: Push to Hub
202
env:
213
HF_TOKEN: ${{ secrets.HF_TOKEN }}
224
run: |
23-
# Force push to the 'main' branch of your Hugging Face Space
5+
# 1. Remove the docs folder from the local temporary sync
6+
rm -rf docs/
7+
8+
# 2. Commit the deletion locally so Git knows they are gone
9+
git config user.name github-actions
10+
git config user.email github-actions@github.com
11+
git add .
12+
git commit -m "Remove docs for HF sync" || echo "No docs to remove"
13+
14+
# 3. Push to Hugging Face
2415
git push -f https://asksunny:$HF_TOKEN@huggingface.co/spaces/asksunny/Compileo main

0 commit comments

Comments
 (0)