From 48970a8603f17d2dad15683283a03172fa396ce6 Mon Sep 17 00:00:00 2001 From: lapatatedouce Date: Mon, 25 Aug 2025 14:32:19 +0200 Subject: [PATCH] =?UTF-8?q?Toujours=20cr=C3=A9er=20un=20tag=20'latest'=20p?= =?UTF-8?q?our=20la=20branche=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 814f1bc..14ec855 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -31,6 +31,14 @@ jobs: uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=sha,prefix={{branch}}- + # Toujours créer un tag 'latest' pour la branche main + type=raw,value=latest,enable={{is_default_branch}} + # Tag avec le nom de la branche pour les autres branches + type=raw,value={{branch}},enable=${{ github.ref_name != 'main' }} - name: Build and push Docker image uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 @@ -38,4 +46,4 @@ jobs: context: . push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }}