david-oplatka commited on
Commit
fa2a5b8
·
2 Parent(s): 776663b 071be84

Merge branch 'main' of github.com:david-oplatka/chatbot-streamlit-base

Browse files
.env CHANGED
@@ -1,4 +1,4 @@
1
- customer_id="YOUR_CUSTOMER_ID"
2
  corpus_ids="YOUR_CORPUS_ID"
3
  api_key="YOUR_API_KEY"
4
  title="TITLE OF STREAMLIT"
 
1
+ customer_id="YOUR_CUSTOMER_ID_1"
2
  corpus_ids="YOUR_CORPUS_ID"
3
  api_key="YOUR_API_KEY"
4
  title="TITLE OF STREAMLIT"
.github/workflows/new_space.yaml CHANGED
@@ -1,4 +1,4 @@
1
- name: Sync to Hugging Face Spaces
2
 
3
  on:
4
  workflow_dispatch:
 
1
+ name: Add New Space
2
 
3
  on:
4
  workflow_dispatch:
.github/workflows/update_spaces.yaml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Update Spaces
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ sync-to-hub:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ with:
14
+ fetch-depth: 0
15
+ lfs: true
16
+
17
+ # Perform specific actions for syncing files
18
+ - name: Sync changed files to Hugging Face
19
+ env:
20
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
21
+ run: |
22
+ git config user.email "[email protected]"
23
+ git config user.name "GitHub Actions"
24
+
25
+ # Check for changed files since last commit
26
+ changed_files=$(git diff --name-only HEAD^)
27
+
28
+ # Iterate through changed files and stage them
29
+ for file in $changed_files; do
30
+ git add $file
31
+ done
32
+
33
+ # Commit changes if there are any
34
+ if [[ -n "$changed_files" ]]; then
35
+ git commit -m "Update changed files"
36
+ git push --force origin main
37
+ else
38
+ echo "No changes detected."
39
+ fi
40
+
41
+ # List of Hugging Face Spaces (child repos)
42
+ spaces=("company-pet-policy" "about-mls" "shakespeare")
43
+
44
+ # Push changes to each Hugging Face Space
45
+ for space_name in "${spaces[@]}"; do
46
+ git remote add space "https://huggingface.co/spaces/${{ github.repository_owner }}/${space_name}.git"
47
+ git push --force space main
48
+ done