cheikhaidev-ui commited on
Commit
2110bce
·
1 Parent(s): fdeb5cf

chore: sync 5 commit(s) from main (text-only, binaries excluded)

Browse files

f5ed362 docs: add DEPLOY.md — dual-remote workflow and push-hf.sh usage
ac3dff6 chore: add push-hf.sh script to automate HF deploy
6c0a2e1 chore: ignore check-*.png verification screenshots
21cbc46 docs(readme): use absolute GitHub raw URLs for screenshots
55deea4 docs(readme): add screenshots section with 3 Playwright captures from live HF Space

Files changed (1) hide show
  1. DEPLOY.md +66 -0
DEPLOY.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Déploiement — LinguaScope
2
+
3
+ LinguaScope a deux remotes :
4
+
5
+ | Remote | URL | Contenu |
6
+ |---|---|---|
7
+ | `origin` | github.com/chniang/linguascope | code + images (historique complet) |
8
+ | `hf` | huggingface.co/spaces/TIJAANI/linguascope | code texte uniquement (HF refuse les binaires) |
9
+
10
+ ---
11
+
12
+ ## Workflow normal
13
+
14
+ ```bash
15
+ git push origin main # toujours en premier
16
+ bash scripts/push-hf.sh # sync HF ensuite
17
+ ```
18
+
19
+ `git push origin main` est un push classique, sans restriction.
20
+ `push-hf.sh` est nécessaire car HF rejette les commits contenant des binaires (PNG, etc.) — les images du README sont hébergées sur GitHub raw et référencées par URL absolue.
21
+
22
+ ---
23
+
24
+ ## Ce que fait `push-hf.sh`
25
+
26
+ 1. Fetch `hf/main` pour connaître l'état actuel du Space
27
+ 2. Diff `hf/main..main`, filtre les extensions binaires (`*.png`, `*.jpg`, `*.gif`, `*.pdf`, `*.woff`…)
28
+ 3. Crée une branche `hf-deploy` depuis le tip HF (historique parallèle, sans binaires)
29
+ 4. Applique les fichiers texte modifiés/ajoutés/supprimés depuis le dernier sync
30
+ 5. Commit + push `hf-deploy → hf/main`, supprime la branche locale
31
+
32
+ Si HF est déjà à jour (aucun fichier texte modifié), le script sort sans rien faire.
33
+
34
+ ---
35
+
36
+ ## Quand l'utiliser
37
+
38
+ | Changement | `origin` | `push-hf.sh` |
39
+ |---|---|---|
40
+ | Code Python (`app.py`, `src/`) | ✅ | ✅ obligatoire pour que l'app redémarre |
41
+ | README / DEPLOY.md | ✅ | ✅ pour mettre à jour la fiche du Space |
42
+ | Ajout d'images dans `screenshots/` | ✅ | ✗ inutile (images sur GitHub raw) |
43
+ | `.gitignore`, `requirements.txt` | ✅ | ✅ |
44
+
45
+ ---
46
+
47
+ ## Ajouter un nouveau type de fichier binaire à exclure
48
+
49
+ Editer la variable `BINARY_EXT` dans `scripts/push-hf.sh` :
50
+
51
+ ```bash
52
+ BINARY_EXT='\.(png|jpg|jpeg|gif|webp|ico|pdf|zip|tar\.gz|woff2?|ttf|eot)$'
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Première utilisation sur un nouveau poste
58
+
59
+ ```bash
60
+ git clone https://github.com/chniang/linguascope.git
61
+ cd linguascope
62
+ git remote add hf https://huggingface.co/spaces/TIJAANI/linguascope
63
+ git fetch hf
64
+ ```
65
+
66
+ Ensuite le workflow normal s'applique.