Spaces:
Running
Running
chaton59
commited on
Commit
·
36e7a30
1
Parent(s):
128eadc
fix: Mises à jour finales pour déploiement HF et CI/CD
Browse files
.github/workflows/ci-cd.yml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
name: CI/CD Pipeline
|
| 2 |
on:
|
| 3 |
push:
|
| 4 |
-
branches: [ main, dev ]
|
| 5 |
pull_request:
|
| 6 |
branches: [ main ]
|
| 7 |
|
|
@@ -51,5 +51,5 @@ jobs:
|
|
| 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
|
|
|
|
| 1 |
name: CI/CD Pipeline
|
| 2 |
on:
|
| 3 |
push:
|
| 4 |
+
branches: [ main, dev ] # Trigger sur main/dev (simplifié, mais branches recommandées Étape 1)
|
| 5 |
pull_request:
|
| 6 |
branches: [ main ]
|
| 7 |
|
|
|
|
| 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, create_repo; login('$HF_TOKEN'); api = HfApi(); repo_id = 'ASI-Engineer/oc_p5-prod' if '${{ github.ref_name }}' == 'main' else 'ASI-Engineer/oc_p5'; create_repo(repo_id=repo_id, repo_type='space', exist_ok=True); api.upload_folder(repo_id=repo_id, folder_path='.', repo_type='space', ignore_patterns=['.git/**', '.github/**'])" # Ajout create_repo (fix 404, exist_ok évite erreur si existant)
|
| 55 |
fi
|