Spaces:
Build error
Build error
Abhinav Gavireddi
commited on
Commit
·
aa18e4f
1
Parent(s):
422bf2d
fix: fixed issue with committing git changes to HF
Browse files
.github/workflows/ci.yaml
CHANGED
@@ -26,6 +26,7 @@ jobs:
|
|
26 |
|
27 |
deploy-to-hf:
|
28 |
runs-on: ubuntu-latest
|
|
|
29 |
environment: prod
|
30 |
steps:
|
31 |
- name: Checkout code
|
@@ -63,7 +64,13 @@ jobs:
|
|
63 |
|
64 |
# Add HF Space repo as remote and push
|
65 |
git remote add hf https://huggingface.co/spaces/${HF_USERNAME}/${HF_SPACE_NAME}.git
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
# Optional: Restart Space via API
|
68 |
python -c "
|
69 |
from huggingface_hub import HfApi;
|
|
|
26 |
|
27 |
deploy-to-hf:
|
28 |
runs-on: ubuntu-latest
|
29 |
+
needs: build-and-test
|
30 |
environment: prod
|
31 |
steps:
|
32 |
- name: Checkout code
|
|
|
64 |
|
65 |
# Add HF Space repo as remote and push
|
66 |
git remote add hf https://huggingface.co/spaces/${HF_USERNAME}/${HF_SPACE_NAME}.git
|
67 |
+
|
68 |
+
git fetch hf main
|
69 |
+
git rebase hf/main || git merge --strategy=ours hf/main
|
70 |
+
|
71 |
+
# Push (force to ensure the workflow always succeeds, or use --force-with-lease for safety)
|
72 |
+
git push hf main --force
|
73 |
+
|
74 |
# Optional: Restart Space via API
|
75 |
python -c "
|
76 |
from huggingface_hub import HfApi;
|