Deminiko commited on
Commit
0cfe787
·
1 Parent(s): 440f6ef
Files changed (2) hide show
  1. .github/workflows/sync-to-hf.yml +15 -11
  2. .hf-config +4 -2
.github/workflows/sync-to-hf.yml CHANGED
@@ -30,19 +30,23 @@ jobs:
30
  git config user.email "github-actions[bot]@users.noreply.github.com"
31
  git config user.name "github-actions[bot]"
32
 
33
- - name: Push to Hugging Face Space
34
  env:
35
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
36
- # HF_USERNAME and HF_SPACE_NAME can be set from .hf-config or secrets
37
  run: |
38
- # Read config values from file
39
- HF_USERNAME=$(grep '^HF_USERNAME=' .hf-config | cut -d'=' -f2)
40
  HF_SPACE_NAME=$(grep '^HF_SPACE_NAME=' .hf-config | cut -d'=' -f2)
41
 
42
- echo "Deploying to: https://huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME"
43
-
44
- # Add space remote (ignore if exists)
45
- git remote add space https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME || true
46
-
47
- # Force push to the space
48
- git push --force https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME main
 
 
 
 
 
 
 
30
  git config user.email "github-actions[bot]@users.noreply.github.com"
31
  git config user.name "github-actions[bot]"
32
 
33
+ - name: Push to Both Hugging Face Spaces
34
  env:
35
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
36
  run: |
37
+ # Read the common space name from the local config file
 
38
  HF_SPACE_NAME=$(grep '^HF_SPACE_NAME=' .hf-config | cut -d'=' -f2)
39
 
40
+ # --- Target 1: MCPNLarchive ---
41
+ HF_USER_1="MCPNLarchive"
42
+ echo "Deploying to Space 1: https://huggingface.co/spaces/$HF_USER_1/$HF_SPACE_NAME"
43
+ git remote add space1 "https://$HF_USER_1:$HF_TOKEN@huggingface.co/spaces/$HF_USER_1/$HF_SPACE_NAME" || true
44
+ git push --force space1 main
45
+ echo "Successfully deployed to Space 1."
46
+
47
+ # --- Target 2: MCPMCP-1st-Birthday ---
48
+ HF_USER_2="MCPMCP-1st-Birthday"
49
+ echo "Deploying to Space 2: https://huggingface.co/spaces/$HF_USER_2/$HF_SPACE_NAME"
50
+ git remote add space2 "https://$HF_USER_2:$HF_TOKEN@huggingface.co/spaces/$HF_USER_2/$HF_SPACE_NAME" || true
51
+ git push --force space2 main
52
+ echo "Successfully deployed to Space 2."
.hf-config CHANGED
@@ -1,4 +1,6 @@
1
  # HF Space Configuration
2
- # Used by GitHub Actions workflow
3
- HF_USERNAME=NLarchive
 
 
4
  HF_SPACE_NAME=QAgents-workflows
 
1
  # HF Space Configuration
2
+ # Used by GitHub Actions workflow to deploy to multiple spaces
3
+ # Deployed to: https://huggingface.co/spaces/MCPNLarchive/QAgents-workflows
4
+ # https://huggingface.co/spaces/MCPMCP-1st-Birthday/QAgents-workflows
5
+ HF_USERNAME=MCPNLarchive
6
  HF_SPACE_NAME=QAgents-workflows