From 2b3c540b5d70bda0ea245402c0290acffe7e861f Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Fri, 20 Oct 2023 16:33:19 +0100 Subject: [PATCH] ci(pytest): set BACKEND_IMG_TAG in all if cases --- .github/workflows/r-pytest.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r-pytest.yml b/.github/workflows/r-pytest.yml index 3f42051828..abebd5e496 100644 --- a/.github/workflows/r-pytest.yml +++ b/.github/workflows/r-pytest.yml @@ -104,17 +104,24 @@ jobs: # Cache backend build image=${{ needs.backend-test-build.outputs.image_tag || inputs.image_tag }} pull_and_package_image "$image" + echo "BACKEND_IMG_TAG=${image}" >> $GITHUB_ENV - name: Load Cached Imgs - if: steps.image-cache.outputs.cache-hit == 'true' + if: ${{ steps.image-cache.outputs.cache-hit == 'true' }} run: | for image_tar in /tmp/images/*; do docker image load --input $image_tar || true done + # Set BACKEND_IMG_TAG if not set + image=$(docker image ls | grep backend) + image_tag="${image##*:}" + echo "Image Tag: $image_tag" + echo "BACKEND_IMG_TAG=${image_tag}" >> $GITHUB_ENV + - name: Vars and Secrets to Env env: - API_TAG_OVERRIDE: ${{ needs.backend-test-build.outputs.image_tag || inputs.image_tag }} + API_TAG_OVERRIDE: ${BACKEND_IMG_TAG} GIT_BRANCH: ${{ github.ref_name }} VARS_CONTEXT: ${{ toJson(vars) }} SECRETS_CONTEXT: ${{ toJson(secrets) }}