diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index f6714f5..ebe3e70 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -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: @@ -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