Skip to content

Commit

Permalink
fix: testing multiple tags
Browse files Browse the repository at this point in the history
  • Loading branch information
genaris committed Mar 19, 2024
1 parent 1c218d4 commit 217c45a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,26 @@ jobs:
run: |
docker build -f Dockerfile -t $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} .
- name: Add tags to Docker image
- name: Add tags to Docker image and push to Docker Hub
if: steps.semantic.outputs.new-release-published == 'true'
run: |
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v${RELEASE_MAJOR}-${GITHUB_REF##*/}
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v${RELEASE_MAJOR}.${RELEASE_MINOR}-${GITHUB_REF##*/}
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v${RELEASE_MAJOR}.${RELEASE_MINOR}.${RELEASE_PATCH}-${GITHUB_REF##*/}
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v$RELEASE_VERSION
docker push $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/}
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR-${GITHUB_REF##*/}
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR.$RELEASE_MINOR-${GITHUB_REF##*/}
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR.$RELEASE_MINOR.$RELEASE_PATCH-${GITHUB_REF##*/}
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_VERSION
- name: Add tags to Docker image (specific to main)
- name: Add tags to Docker image and push to Docker Hub (specific to main)
if: github.ref == 'refs/heads/main' && steps.semantic.outputs.new-release-published == 'true'
run: |
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v${RELEASE_MAJOR}
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v${RELEASE_MAJOR}.${RELEASE_MINOR}
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v${RELEASE_MAJOR}.${RELEASE_MINOR}.${RELEASE_PATCH}
- name: Push Docker image to Docker Hub
if: steps.semantic.outputs.new-release-published == 'true'
run: |
docker push $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} -a
docker push $DH_USERNAME/$IMAGE_NAME:v${RELEASE_MAJOR}
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR.$RELEASE_MINOR
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR.$RELEASE_MINOR.$RELEASE_PATCH

0 comments on commit 217c45a

Please sign in to comment.