Update sync_to_hf.yml
Browse files
.github/workflows/sync_to_hf.yml
CHANGED
|
@@ -1,8 +1,29 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Sync to Hugging Face Hub
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [main]
|
| 6 |
+
# Isse tum manually bhi button daba kar sync kar sakte ho
|
| 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 # Latest version
|
| 15 |
+
with:
|
| 16 |
+
fetch-depth: 0
|
| 17 |
+
lfs: true
|
| 18 |
+
|
| 19 |
+
- name: Push to Hugging Face
|
| 20 |
+
env:
|
| 21 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 22 |
+
run: |
|
| 23 |
+
# Git configuration
|
| 24 |
+
git config --global user.email "shantanupathak94@gmail.com"
|
| 25 |
+
git config --global user.name "shantanu"
|
| 26 |
+
|
| 27 |
+
# Force push to HF Space (shantanupathak94/Ai-code-editor)
|
| 28 |
+
git remote add hf https://shantanupathak94:$HF_TOKEN@huggingface.co/spaces/shantanupathak94/Ai-code-editor
|
| 29 |
+
git push --force hf main
|