marintosti12 commited on
Commit
1e3df73
·
1 Parent(s): 7ea6ddc

fix(git) : git credentials actions

Browse files
Files changed (1) hide show
  1. .github/workflows/deploy.yaml +10 -7
.github/workflows/deploy.yaml CHANGED
@@ -38,26 +38,29 @@ jobs:
38
  echo "HF secrets manquants, on skip le déploiement."
39
  exit 0
40
 
 
 
 
 
 
 
41
  - name: Prepare snapshot (no history, no binaries)
42
  shell: bash
43
  run: |
44
- # 1) Crée une branche orpheline (il faut un working tree clean)
45
  git switch --orphan hfdeploy
46
-
47
- # 2) Réinitialise l'index pour repartir propre sur l'état du working tree
48
  git reset
49
 
50
- # 3) Ajoute les patterns d'ignore AVANT de stagier les fichiers
51
  printf "\n# ML artifacts\n*.joblib\n*.pkl\n*.pt\n*.onnx\n" >> .gitignore
52
 
53
- # 4) (optionnel) si un .joblib est déjà indexé, enlève-le sans erreur si pas de match
54
  git rm -r --cached --ignore-unmatch -- notebook/*.joblib
55
 
56
- # 5) Stage tout ce qui n’est pas ignoré et commit la snapshot
57
  git add -A
58
  git commit -m "Space deploy snapshot ${GITHUB_SHA}"
59
 
60
-
61
  - name: Configure Git
62
  run: |
63
  git config --global user.email "${HF_GIT_EMAIL}"
 
38
  echo "HF secrets manquants, on skip le déploiement."
39
  exit 0
40
 
41
+ - name: Configure Git identity (local)
42
+ shell: bash
43
+ run: |
44
+ git config user.email "${HF_GIT_EMAIL:-actions@github.com}"
45
+ git config user.name "${HF_GIT_NAME:-github-actions}"
46
+
47
  - name: Prepare snapshot (no history, no binaries)
48
  shell: bash
49
  run: |
50
+ # 1) Branche orpheline
51
  git switch --orphan hfdeploy
 
 
52
  git reset
53
 
54
+ # 2) Ignore les artefacts ML
55
  printf "\n# ML artifacts\n*.joblib\n*.pkl\n*.pt\n*.onnx\n" >> .gitignore
56
 
57
+ # 3) Retire de l'index si jamais ça match (silencieux sinon)
58
  git rm -r --cached --ignore-unmatch -- notebook/*.joblib
59
 
60
+ # 4) Commit de la snapshot
61
  git add -A
62
  git commit -m "Space deploy snapshot ${GITHUB_SHA}"
63
 
 
64
  - name: Configure Git
65
  run: |
66
  git config --global user.email "${HF_GIT_EMAIL}"