Skip to content

Commit

Permalink
Merge pull request #1748 from ANTsX/docker_tag_semver
Browse files Browse the repository at this point in the history
CI: Use semver-compatible Docker tags, ie 2.5.3 instead of v2.5.3
  • Loading branch information
cookpa authored May 16, 2024
2 parents 9b90bbe + 4f41e67 commit e039793
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,27 @@ jobs:
uses: docker/metadata-action@v5
with:
images: antsx/ants
tags: |
type=ref,event=tag,enable=true,strip-prefix=v
type=ref,event=branch
type=ref,event=pr,prefix=pr-
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Edit tag for releases
run: |
META_TAG=${{ steps.meta.outputs.tags }}
STRIPPED_TAG=$( echo "${META_TAG#v}" )
echo "DOCKER_TAG=${STRIPPED_TAG}" >> $GITHUB_ENV
-
name: Build and load (PR) or push (commit/tag)
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
load: ${{ github.event_name == 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ env.DOCKER_TAG }},${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
-
name: Export Docker image for PR
Expand Down

0 comments on commit e039793

Please sign in to comment.