mirror of
https://github.com/skylanix/MamieHenriette.git
synced 2026-02-16 21:10:37 +01:00
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:
51
.github/workflows/docker-build.yml
vendored
Normal file
51
.github/workflows/docker-build.yml
vendored
Normal 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 }}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
services:
|
services:
|
||||||
mamiehenriette:
|
mamiehenriette:
|
||||||
container_name: MamieHenriette
|
container_name: MamieHenriette
|
||||||
build: .
|
image: ghcr.io/skylanix/mamiehenriette:latest
|
||||||
|
# build: .
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
- ENABLE_ZABBIX=false
|
- ENABLE_ZABBIX=false
|
||||||
|
|||||||
Reference in New Issue
Block a user