Skip to content

Commit

Permalink
ci: try another thing for the tag
Browse files Browse the repository at this point in the history
  • Loading branch information
amitkparekh committed Dec 1, 2023
1 parent a07ac8c commit 8b59495
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,15 @@ jobs:
packages: write

steps:
- name: Get latest release tag
id: release-tag
uses: rez0n/actions-github-release@main
env:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
type: "stable"

- name: Define image tag
id: image-tag
env:
RELEASE_VERSION: ${{ steps.release-tag.outputs.release }}
TORCH_VERSION_SUFFIX: ${{ matrix.torch_version_suffix }}
run: |
IMAGE_TAG=$(echo "$RELEASE_VERSION" | cut -d v -f 2)
IMAGE_TAG=$(echo "$IMAGE_TAG$TORCH_VERSION_SUFFIX" | tr + -)
if [[ $TORCH_VERSION_SUFFIX == "" ]]; then
TORCH_VERSION_SUFFIX="cpu"
fi
IMAGE_TAG=$(echo "$TORCH_VERSION_SUFFIX" | tr -d '+')
echo "tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT"
- name: Check out the repository
Expand All @@ -57,14 +51,12 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
env:
IMAGE_TAG: ${{ steps.image-tag.outputs.tag }}
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}
tags: |
type=raw,value=${{env.IMAGE_TAG}},enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=${{env.IMAGE_TAG}},enable={{is_default_branch}}
type=raw,value=${{steps.image-tag.outputs.tag}},enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=${{steps.image-tag.outputs.tag}},enable={{is_default_branch}}
- name: Build and push image
uses: docker/build-push-action@v5
Expand Down

0 comments on commit 8b59495

Please sign in to comment.