ajout build Docker automatisé via GitHub Actions

- Ajout workflow GitHub Actions pour build automatique des images Docker
  - Configuration publication sur GitHub Container Registry (ghcr.io)
  - Mise à jour docker-compose.yml pour utiliser l'image hébergée
  - Support build multi-plateforme et étiquetage automatique
This commit is contained in:
skylanix
2025-08-12 15:31:17 +02:00
parent 8f243f626e
commit c55151511d
2 changed files with 53 additions and 1 deletions

51
.github/workflows/docker-build.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Build and Push Docker Image
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: skylanix/mamiehenriette
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -1,7 +1,8 @@
services:
mamiehenriette:
container_name: MamieHenriette
build: .
image: ghcr.io/skylanix/mamiehenriette:latest
# build: .
restart: on-failure
environment:
- ENABLE_ZABBIX=false