Spaces:
Paused
Paused
Selcan Yukcu
commited on
Commit
·
882bbbb
1
Parent(s):
c772733
feat: revise deployment workflow to force push clean history to Hugging Face Space
Browse files- .github/workflows/deploy.yml +22 -12
.github/workflows/deploy.yml
CHANGED
|
@@ -1,19 +1,29 @@
|
|
| 1 |
-
name: Sync
|
| 2 |
|
| 3 |
on:
|
| 4 |
push:
|
| 5 |
-
branches:
|
| 6 |
-
- main
|
| 7 |
|
| 8 |
jobs:
|
| 9 |
-
|
| 10 |
runs-on: ubuntu-latest
|
| 11 |
steps:
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Sync to Hugging Face Hub
|
| 2 |
|
| 3 |
on:
|
| 4 |
push:
|
| 5 |
+
branches: [main]
|
|
|
|
| 6 |
|
| 7 |
jobs:
|
| 8 |
+
sync-to-hub:
|
| 9 |
runs-on: ubuntu-latest
|
| 10 |
steps:
|
| 11 |
+
- name: Checkout
|
| 12 |
+
uses: actions/checkout@v3
|
| 13 |
+
with:
|
| 14 |
+
fetch-depth: 0 # Full history required
|
| 15 |
+
lfs: true
|
| 16 |
+
|
| 17 |
+
- name: Configure Git
|
| 18 |
+
run: |
|
| 19 |
+
git config --global user.email "actions@github.com"
|
| 20 |
+
git config --global user.name "GitHub Actions"
|
| 21 |
+
|
| 22 |
+
- name: Force push clean history to HF Space
|
| 23 |
+
env:
|
| 24 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 25 |
+
HF_SPACE_ID: ${{ vars.HF_SPACE_ID }}
|
| 26 |
+
run: |
|
| 27 |
+
git remote add hf "https://api:$HF_TOKEN@huggingface.co/spaces/$HF_SPACE_ID"
|
| 28 |
+
git fetch hf
|
| 29 |
+
git push hf main --force
|