chaton59 commited on
Commit
60d53aa
·
1 Parent(s): 4fc1fae

fix: Mise à jour CI/CD YAML pour déploiement HF

Browse files
Files changed (1) hide show
  1. .github/workflows/ci-cd.yml +6 -2
.github/workflows/ci-cd.yml CHANGED
@@ -47,5 +47,9 @@ jobs:
47
  - name: Deploy to HF Spaces
48
  env:
49
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
50
- REF_NAME: ${{ github.ref_name }}
51
- run: python .github/scripts/deploy.py
 
 
 
 
 
47
  - name: Deploy to HF Spaces
48
  env:
49
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
50
+ run: |
51
+ if [ -z "$HF_TOKEN" ]; then
52
+ echo "Deploy step ready - configure HF_TOKEN secret in GitHub settings"
53
+ else
54
+ python -c "from huggingface_hub import login, HfApi; login('$HF_TOKEN'); api = HfApi(); repo_id = 'ASI-Engineer/oc_p5-prod' if '${{ github.ref_name }}' == 'main' else 'ASI-Engineer/oc_p5'; api.upload_folder(repo_id=repo_id, folder_path='.', repo_type='space', ignore_patterns=['.git/**', '.github/**'])"
55
+ fi