Spaces:
Sleeping
Sleeping
Update update_space_2.yaml
Browse files
.github/workflows/update_space_2.yaml
CHANGED
@@ -33,14 +33,19 @@ jobs:
|
|
33 |
run: |
|
34 |
huggingface-cli login --token $HF_TOKEN
|
35 |
|
|
|
|
|
|
|
|
|
|
|
36 |
- name: Fetch changes from Hugging Face space
|
37 |
-
run: git fetch
|
38 |
|
39 |
- name: Push only changed files
|
40 |
run: |
|
41 |
for file in $(git diff --name-only HEAD~1 HEAD); do
|
42 |
-
git checkout
|
43 |
git add $file
|
44 |
git commit -m "Update $file in ${{ matrix.space_name }}"
|
45 |
-
git push
|
46 |
done
|
|
|
33 |
run: |
|
34 |
huggingface-cli login --token $HF_TOKEN
|
35 |
|
36 |
+
- name: Add Hugging Face Space as remote
|
37 |
+
run: |
|
38 |
+
git remote add space_${{ matrix.space_name }} https://david-oplatka:$HF_TOKEN@huggingface.co/spaces/david-oplatka/${{ matrix.space_name }}.git
|
39 |
+
git config --add remote.space_${{ matrix.space_name }}.oauth_token $HF_TOKEN
|
40 |
+
|
41 |
- name: Fetch changes from Hugging Face space
|
42 |
+
run: git fetch space_${{ matrix.space_name }}
|
43 |
|
44 |
- name: Push only changed files
|
45 |
run: |
|
46 |
for file in $(git diff --name-only HEAD~1 HEAD); do
|
47 |
+
git checkout space_${{ matrix.space_name }}/main -- $file
|
48 |
git add $file
|
49 |
git commit -m "Update $file in ${{ matrix.space_name }}"
|
50 |
+
git push space_${{ matrix.space_name }} HEAD:main
|
51 |
done
|