rkonan commited on
Commit
0843999
·
1 Parent(s): 4182d07

ajout readme

Browse files
Files changed (1) hide show
  1. README.md +71 -0
README.md ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Recoplante Streamlit
3
+ emoji: 🌿🔍
4
+ colorFrom: green
5
+ colorTo: yellow
6
+ sdk: docker
7
+ pinned: true
8
+ ---
9
+
10
+
11
+
12
+
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
14
+
15
+ # installer le projet en local
16
+ git clone https://github.com/rkonan/reco-plante.git
17
+ cd reco-plante
18
+ python3 -m venv venv
19
+ source venv/bin/activate
20
+ pip install -r requirements.txt
21
+ lancement sur api local => export API_ENV=local && streamlit run app/main.py
22
+ lancement sur api distante => export API_ENV=space && streamlit run app/main.py
23
+
24
+ # 🚀 Déploiement automatique vers Hugging Face Spaces
25
+
26
+ Ce dépôt est relié automatiquement à un **Hugging Face Space** :
27
+ 🔗 [https://huggingface.co/spaces/reco-team/reco-plante](https://huggingface.co/spaces/reco-team/reco-plante)
28
+
29
+ ---
30
+
31
+ ## ⚙️ Workflow de déploiement
32
+
33
+ À chaque `push` sur la branche `main`, un workflow GitHub Actions est déclenché :
34
+ - Il vérifie le code
35
+ - Il pousse automatiquement le contenu vers le Space `reco-team/reco-plante` sur Hugging Face
36
+
37
+ Les contributeurs **n'ont pas besoin d'un compte Hugging Face** :
38
+ ✅ Tout le déploiement est géré par GitHub Actions.
39
+
40
+ ---
41
+
42
+ ## 📦 Structure technique
43
+
44
+ - Workflow : `.github/workflows/deploy.yaml`
45
+ - Branche surveillée : `main`
46
+ - Hugging Face Space cible : `reco-team/reco-plante`
47
+
48
+ ---
49
+
50
+ ## 🔒 Sécurité
51
+
52
+ Le workflow utilise un **secret `HF_TOKEN` stocké dans GitHub** :
53
+ - Ce token a des permissions `write` sur Hugging Face Spaces
54
+ - Il n'est jamais exposé dans le code source
55
+
56
+ ---
57
+
58
+ ## 👩‍💻 Usage pour les développeurs
59
+
60
+ - **Collaborer normalement sur GitHub**
61
+ - **Créer des PRs ou pousser directement sur `main` si autorisé**
62
+ - Aucun `git push` manuel vers Hugging Face n’est requis
63
+
64
+ ---
65
+
66
+ ## 📝 Remarque importante
67
+
68
+ 💡 Si vous avez besoin de **tester le Space localement avant de pousser**, vous pouvez cloner le repo et tester avec :
69
+ ```bash
70
+ lancement sur api local => export API_ENV=local && streamlit run app/main.py
71
+ lancement sur api distante => export API_ENV=space && streamlit run app/main.py