Files
build-image/README.md
2025-04-14 12:53:45 +02:00

66 lines
2.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# L'action `build-image`
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
```yaml
- 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
```
---
## 📥 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. |
---
## ▶️ 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
```
---
## ⚙️ Comportement
- 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`.
---
## 🧡 À propos
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/)