Skip to content

Commit

Permalink
chore: revert docker image tag logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Aug 22, 2024
1 parent 733216c commit 254325e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/release-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ jobs:
result-encoding: string
script: |
const fullTag = '${{ inputs.tag }}';
const firstMinusIndex = fullTag.indexOf('-');
if (firstMinusIndex !== -1) {
return fullTag.substring(firstMinusIndex);
if (fullTag.includes('-')) {
const suffixes = fullTag.split('-').slice(1); // Ignore the version part
const firstElements = suffixes.map(suffix => suffix.split('.')[0]);
return "${firstElements.join('-')}"";
} else {
return '';
}
Expand All @@ -120,12 +121,14 @@ jobs:
with:
images: ${{ inputs.image_org }}/${{ inputs.image_name }}
tags: |
type=semver,pattern={{version}},priority=950,value=${{ inputs.tag }}
type=semver,pattern={{major}}.{{minor}},value=${{ inputs.tag }}
type=semver,pattern={{major}},value=${{ inputs.tag }}
type=ref,event=pr
type=match,pattern=v(\d+),group=1,value=${{ steps.version.outputs.result }}
type=match,pattern=v(\d+.\d+),group=1,value=${{ steps.version.outputs.result }}
type=match,pattern=v(\d+.\d+.\d+),group=1,value=${{ steps.version.outputs.result }}
type=match,pattern=v(.*),group=1,value=${{ steps.version.outputs.result }},suffix=
flavor: |
latest=${{ github.event_name == 'release' && !github.event.release.prerelease && steps.suffix.outputs.result == '' }}
suffix=${{ steps.suffix.outputs.result }},onlatest=true
latest=${{ github.event_name == 'release' }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand Down

0 comments on commit 254325e

Please sign in to comment.