File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,17 @@ jobs:
48
48
id : date
49
49
run : echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
50
50
51
+ - name : Determine Tag Name Based on Branch
52
+ id : determine_tag
53
+ run : echo "tagname=${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.head_ref || 'default' }}" >> $GITHUB_OUTPUT
54
+
51
55
- name : Build Docker Image and optionally push
52
56
uses : docker/build-push-action@v6
53
57
with :
54
58
context : .
55
59
file : ${{ inputs.dockerfile }}
56
60
push : ${{ inputs.push }}
57
- cache-from : type=registry,ref=${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || 'latest' }}
61
+ cache-from : type=registry,ref=${{ inputs.registry }}/${{ inputs.app_name}}:${{ steps.determine_tag.outputs.tagname }}
58
62
tags : |
59
- ${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || 'latest' }}
60
- ${{ inputs.registry }}/${{ inputs.app_name}}:${{ steps.date.outputs.date }}_${{ github.run_number }}
63
+ ${{ inputs.registry }}/${{ inputs.app_name}}:${{ steps.determine_tag.outputs.tagname }}
64
+ ${{ inputs.registry }}/${{ inputs.app_name}}:${{ steps.determine_tag.outputs.tagname }}_${{ steps. date.outputs.date }}_${{ github.run_number }}
You can’t perform that action at this time.
0 commit comments