Skip to content

Commit ae1e823

Browse files
committed
fix problem image tag check
1 parent 50abe84 commit ae1e823

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/build_image.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Check if image tag exists
5353
id: check_tag
5454
env:
55-
IMAGE_TAG: ${{ env.REGISTRY }}/scverse/spatialdata:spatialdata${{ env.SPATIALDATA_VERSION }}_spatialdata-io${{ env.SPATIALDATA_IO_VERSION }}_spatialdata-plot${{ env.SPATIALDATA_PLOT_VERSION }}
55+
IMAGE_TAG_SUFFIX: spatialdata${{ env.SPATIALDATA_VERSION }}_spatialdata-io${{ env.SPATIALDATA_IO_VERSION }}_spatialdata-plot${{ env.SPATIALDATA_PLOT_VERSION }}
5656
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5757
run: |
5858
# Define the API URL
@@ -66,13 +66,13 @@ jobs:
6666
echo "$existing_tags"
6767
6868
# Check if the constructed tag exists
69-
if echo "$existing_tags" | grep -q "$IMAGE_TAG"; then
70-
echo "Image tag $IMAGE_TAG already exists. Skipping build."
69+
if echo "$existing_tags" | grep -q "$IMAGE_TAG_SUFFIX"; then
70+
echo "Image tag $IMAGE_TAG_SUFFIX already exists. Skipping build."
7171
echo "skip_build=true" >> $GITHUB_ENV
7272
else
73-
echo "Image tag $IMAGE_TAG does not exist. Proceeding with build."
73+
echo "Image tag $IMAGE_TAG_SUFFIX does not exist. Proceeding with build."
7474
echo "skip_build=false" >> $GITHUB_ENV
75-
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
75+
echo "IMAGE_TAG_SUFFIX=${IMAGE_TAG_SUFFIX}" >> $GITHUB_ENV
7676
fi
7777
7878
- name: Login to GitHub Container Registry
@@ -85,6 +85,7 @@ jobs:
8585

8686
- uses: docker/build-push-action@v5
8787
if: ${{ env.skip_build == 'false' }}
88+
IMAGE_TAG: ${{ env.REGISTRY }}/scverse/spatialdata:${{ env.IMAGE_TAG_SUFFIX }}
8889
with:
8990
context: .
9091
file: ./Dockerfile

0 commit comments

Comments
 (0)