Skip to content

Commit

Permalink
ci: try get the version from poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
amitkparekh committed Dec 1, 2023
1 parent 9ed19da commit 759d457
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,27 @@ jobs:
packages: write

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"

- name: Define image suffix
id: image-tag
env:
TORCH_VERSION_SUFFIX: ${{ matrix.torch_version_suffix }}
run: |
IMAGE_TAG=$(poetry version -s)
IMAGE_TAG=$(echo "$TORCH_VERSION_SUFFIX" | tr + -)
echo "tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT"
- name: Check out the repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand All @@ -49,7 +59,7 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}
tags: |
type=pep440,enable=true,priority=900,suffix=${{ steps.image-tag.outputs.tag }}
${{ steps.image-tag.outputs.tag }}
- name: Build and push image
uses: docker/build-push-action@v5
Expand Down

0 comments on commit 759d457

Please sign in to comment.