This commit is contained in:
Paul Schneider 2026-06-07 05:09:57 +01:00
commit 69f8d4b1d2
2 changed files with 41 additions and 0 deletions

41
.github/workflows/docker-publish.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
workflow_dispatch: # Permet de lancer le build manuellement depuis GitHub
jobs:
build-and-push:
runs-on: debian-latest
steps:
# 1. Récupération du code source
- name: Check out the repo
uses: actions/checkout@v4
# 2. Configuration de Docker Buildx (indispensable pour la gestion avancée du cache)
- name: Set up Docker Buildx
uses: actions/setup-buildx-action@v3
# 3. Connexion à Docker Hub en utilisant les secrets configurés
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# 4. Construction et envoi de l'image
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
pazof/yavsc-build-env:latest
pazof/yavsc-build-env:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max