Spaces:
Sleeping
Sleeping
Update update_space_2.yaml
Browse files
.github/workflows/update_space_2.yaml
CHANGED
@@ -10,8 +10,7 @@ jobs:
|
|
10 |
runs-on: ubuntu-latest
|
11 |
strategy:
|
12 |
matrix:
|
13 |
-
space_name: [company-pet-policy, about-mls, shakespeare]
|
14 |
-
|
15 |
steps:
|
16 |
- name: Checkout repository
|
17 |
uses: actions/checkout@v2
|
@@ -24,14 +23,29 @@ jobs:
|
|
24 |
git config --global user.email "[email protected]"
|
25 |
git config --global user.name "GitHub Actions"
|
26 |
|
27 |
-
- name:
|
28 |
-
run:
|
29 |
-
git fetch origin
|
30 |
-
git reset --soft origin/main
|
31 |
|
32 |
-
- name:
|
33 |
env:
|
34 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
35 |
run: |
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
runs-on: ubuntu-latest
|
11 |
strategy:
|
12 |
matrix:
|
13 |
+
space_name: [company-pet-policy, about-mls, shakespeare] # List your Hugging Face space names here
|
|
|
14 |
steps:
|
15 |
- name: Checkout repository
|
16 |
uses: actions/checkout@v2
|
|
|
23 |
git config --global user.email "[email protected]"
|
24 |
git config --global user.name "GitHub Actions"
|
25 |
|
26 |
+
- name: Install huggingface_hub
|
27 |
+
run: pip install huggingface_hub
|
|
|
|
|
28 |
|
29 |
+
- name: Login to Hugging Face (store token as a secret)
|
30 |
env:
|
31 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
32 |
run: |
|
33 |
+
echo $HF_TOKEN | huggingface-cli login
|
34 |
+
|
35 |
+
- name: Get Space Name
|
36 |
+
id: get_space_name
|
37 |
+
run: echo ${{ matrix.space_name }}
|
38 |
+
|
39 |
+
- name: Add Hugging Face Space as remote (loop through each space)
|
40 |
+
run: |
|
41 |
+
git remote add ${{ steps.get_space_name.outputs.value }} https://$david-oplatka/$${{ steps.get_space_name.outputs.value }}.git
|
42 |
+
git config --add remote.$ ${{ steps.get_space_name.outputs.value }}.oauth_token ${{ secrets.HF_TOKEN }}
|
43 |
+
|
44 |
+
- name: Get changed files
|
45 |
+
id: changed_files
|
46 |
+
run: |
|
47 |
+
git diff --name-only origin/main HEAD
|
48 |
+
|
49 |
+
- name: Push only changed files (loop through each space)
|
50 |
+
run: |
|
51 |
+
git push ${{ steps.get_space_name.outputs.value }} --prune $(echo ${{ steps.changed_files.outputs.value }})
|