Skip to content

Commit

Permalink
リリースであればバージョンを追加し、それ以外であればlatestを追加する
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Jan 16, 2022
1 parent b59ae6d commit ba454b4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,16 @@ jobs:
- name: Build and Deploy Docker image
uses: docker/build-push-action@v2
env:
IMAGE_TAG: ${{ env.IMAGE_NAME }}:${{ matrix.tag }}${{ (matrix.tag != '' && '-') || '' }}latest
VERSIONED_IMAGE_TAG: |
IMAGE_TAG: |- # If it's a release, add the version, otherwise add the `latest`
${{ (
github.event.release.tag_name != '' && (
matrix.tag != '' && (
format('{0}:{1}-{2}', env.IMAGE_NAME, matrix.tag, github.event.release.tag_name)
) || format('{0}:{1}', env.IMAGE_NAME, github.event.release.tag_name)
)
) || '' }}
) || (
format('{0}:{1}{2}latest', env.IMAGE_NAME, matrix.tag, (matrix.tag != '' && '-') || ''
) }}
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
Expand All @@ -117,8 +118,6 @@ jobs:
ONNXRUNTIME_URL=${{ matrix.onnxruntime_url }}
target: ${{ matrix.target }}
push: true
tags: |
${{ env.IMAGE_TAG }}
${{ env.VERSIONED_IMAGE_TAG }}
tags: ${{ env.IMAGE_TAG }}
cache-from: type=registry,ref=${{ env.IMAGE_TAG }}-buildcache
cache-to: type=registry,ref=${{ env.IMAGE_TAG }}-buildcache,mode=max

0 comments on commit ba454b4

Please sign in to comment.