david-oplatka commited on
Commit
3cf1e97
·
unverified ·
1 Parent(s): ec24648

Update update_space_2.yaml

Browse files
.github/workflows/update_space_2.yaml CHANGED
@@ -23,22 +23,26 @@ jobs:
23
  run: |
24
  git config --global user.email "[email protected]"
25
  git config --global user.name "GitHub Actions"
26
-
27
- - name: Get and show changed files
28
  id: changed_files
29
  run: |
30
  git fetch origin
31
- git diff --name-only HEAD~1 HEAD || true
 
 
 
 
 
32
 
33
- - name: Push only changed files (loop through each space)
34
  env:
35
- HF_TOKEN: ${{ secrets.HF_TOKEN }}
36
  run: |
37
  changed_files="${{ steps.changed_files.outputs.value }}"
 
38
  for file in $changed_files; do
39
  git add $file
40
  git commit -m "Updating $file"
41
- git remote add ${{ matrix.space_name }} https://huggingface.co/spaces/david-oplatka/${{ matrix.space_name }}.git
42
- git config --add remote.${{ matrix.space_name }}.oauth_token ${{ secrets.HF_TOKEN }}
43
- git push ${{ matrix.space_name }} main
44
  done
 
23
  run: |
24
  git config --global user.email "[email protected]"
25
  git config --global user.name "GitHub Actions"
26
+
27
+ - name: Get changed files
28
  id: changed_files
29
  run: |
30
  git fetch origin
31
+ echo "::set-output name=value::$(git diff --name-only HEAD~1 HEAD || true)"
32
+
33
+ - name: Show changed files
34
+ run: |
35
+ echo "Changed files:"
36
+ echo "${{ steps.changed_files.outputs.value }}"
37
 
38
+ - name: Push changed files to Hugging Face
39
  env:
40
+ HF_TOKEN: ${{ secrets.HF_TOKEN }} # Your Hugging Face token secret
41
  run: |
42
  changed_files="${{ steps.changed_files.outputs.value }}"
43
+ echo "Files to push: $changed_files"
44
  for file in $changed_files; do
45
  git add $file
46
  git commit -m "Updating $file"
47
+ git push https://david-oplatka:$HF_TOKEN@huggingface.co/spaces/david-oplatka/${{ github.event.repository.name }}.git main
 
 
48
  done