Files

66 lines
2.7 KiB
Markdown
Raw Permalink Normal View History

2025-04-14 10:57:40 +02:00
2025-04-14 12:53:45 +02:00
# L'action `build-image`
2025-04-14 10:57:40 +02:00
2025-04-14 12:53:45 +02:00
Cette action permet de créer une image Docker et de la taguer avec les outils `docker` ou `podman`.
Elle est conçue pour être utilisée dans des workflows Gitea avec des runners auto-hébergés.
---
## 🔧 Utilisation
2025-04-14 10:57:40 +02:00
```yaml
2025-04-14 12:53:45 +02:00
- name: Build and tag Docker image
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/build-image@main
with:
image_name: my_image
image_tags: latest stable
2025-04-14 10:57:40 +02:00
```
2025-04-14 12:53:45 +02:00
---
## 📥 Paramètres
| Nom | Obligatoire | Par défaut | Description |
|------------------|-------------|-------------------------------------|---------------------------------------------------------------------------------|
| `image_name` | ✅ | | Nom de l'image à construire. |
| `image_tags` | ✅ | | Liste des tags à ajouter à l'image. |
| `registry_server`| ❌ | `niepce.petite-maison-orange.fr` | Adresse du serveur d'enregistrement des images Docker. |
| `build_command` | ❌ | `docker` | Commande à utiliser pour construire l'image (`docker` ou `podman`). |
| `tag_command` | ❌ | `podman` | Commande à utiliser pour taguer l'image (`docker` ou `podman`). |
| `debug` | ❌ | `false` | Mode débogage. Si activé, affiche des informations détaillées pendant l'exécution. |
---
2025-04-14 10:57:40 +02:00
2025-04-14 12:53:45 +02:00
## ▶️ Exemple de workflow
```yaml
- name: Build Docker image
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/build-image@main
with:
image_name: my_image
image_tags: latest stable
- name: Notify Healthchecks
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
with:
check_server: https://hc-ping.com
check_uuid: a1b2c3d4-1234-5678-9abc-def123456789
check_command: start
```
2025-04-14 10:57:40 +02:00
2025-04-14 12:53:45 +02:00
---
2025-04-14 10:57:40 +02:00
2025-04-14 12:53:45 +02:00
## ⚙️ Comportement
2025-04-14 10:57:40 +02:00
2025-04-14 12:53:45 +02:00
- Si la commande `build_command` échoue, l'action renvoie une erreur.
- Si la commande `tag_command` échoue, l'action renvoie une erreur.
- Si les commandes `build_command` et `tag_command` diffèrent, l'image est transférée du format de la commande `build_command` vers celui de `tag_command`.
2025-04-14 10:57:40 +02:00
2025-04-14 12:53:45 +02:00
---
2025-04-14 10:57:40 +02:00
2025-04-14 12:53:45 +02:00
## 🧡 À propos
2025-04-14 10:57:40 +02:00
2025-04-14 12:53:45 +02:00
Cette action fait partie des actions de la **Petite Maison Orange**.
Toutes les actions sont disponibles ici :
👉 [https://gargoton.petite-maison-orange.fr/pmo-actions/](https://gargoton.petite-maison-orange.fr/pmo-actions/)