Skip to content

Commit

Permalink
feature:Creation d'image docker via creation de tag
Browse files Browse the repository at this point in the history
  • Loading branch information
David-IGN committed Dec 16, 2024
1 parent 2356515 commit 93eb9db
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
on:
push:
tags:
- 'v*.*.*' # Se déclenche uniquement pour les tags au format vx.x.x
workflow_dispatch:
inputs:
version:
Expand All @@ -18,6 +21,18 @@ jobs:
packages: write

steps:
- name: Set version for build
id: set_version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
VERSION="${{ github.event.inputs.version }}"
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
VERSION="${{ github.ref_name }}"
else
echo "Error: Unsupported event type"
exit 1
fi
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Validate version input
id: validate_version
run: |
Expand Down Expand Up @@ -57,4 +72,4 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
target: 'prod' # Cible le stage (prod)
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max

0 comments on commit 93eb9db

Please sign in to comment.