david-oplatka commited on
Commit
db40fc9
·
unverified ·
1 Parent(s): 24211f9

Update update_space_2.yaml

Browse files
.github/workflows/update_space_2.yaml CHANGED
@@ -1,8 +1,7 @@
1
  name: Update Space
 
2
  on:
3
- push:
4
- branches:
5
- - main
6
 
7
  jobs:
8
  sync-to-hub:
@@ -23,9 +22,14 @@ jobs:
23
  git config --global user.email "actions@github.com"
24
  git config --global user.name "GitHub Actions"
25
 
26
- - name: Push to Hugging Face
 
 
 
 
 
27
  env:
28
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
29
  run: |
30
  git remote add space https://david-oplatka:$HF_TOKEN@huggingface.co/spaces/david-oplatka/${{ matrix.space_name }}.git
31
- git push space main
 
1
  name: Update Space
2
+
3
  on:
4
+ workflow_dispatch:
 
 
5
 
6
  jobs:
7
  sync-to-hub:
 
22
  git config --global user.email "actions@github.com"
23
  git config --global user.name "GitHub Actions"
24
 
25
+ - name: Fetch changes from origin
26
+ run: |
27
+ git fetch origin
28
+ git reset --soft origin/main
29
+
30
+ - name: Push changes to Hugging Face
31
  env:
32
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
33
  run: |
34
  git remote add space https://david-oplatka:$HF_TOKEN@huggingface.co/spaces/david-oplatka/${{ matrix.space_name }}.git
35
+ git push --force-with-lease space main