Skip to content

Commit

Permalink
ci: use step outputs instead of step failure for control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Clerkx committed Nov 21, 2023
1 parent 1bb65d2 commit 692f2df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tag-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ jobs:
run: |
if [ $(docker manifest inspect ${{ env.FULL_BUILT_IMAGE_NAME }}) ]; then
echo "Image already exists"
exit 0
echo "image_exists=true" >> "$GITHUB_OUTPUT"
else
echo "Image does not exist, we will build and push it"
exit 1
echo "image_exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Tag existing container image
if: ${{ steps.check_image.conclusion == 'success' }}
if: ${{ steps.check_image.outputs.image_exists == 'true' }}
run: |
docker buildx imagetools create ${{ env.FULL_BUILT_IMAGE_NAME }} --tag ${{ env.FULL_IMAGE_TO_PUSH_W_TAG }}:${{ env.TAG_TO_PUSH }}
- name: Build and Push image to ACR
if: ${{ steps.check_image.conclusion == 'failure' }}
if: ${{ steps.check_image.outputs.image_exists == 'false' }}
run: |
docker buildx build --platform linux/amd64 --tag ${{ env.FULL_BUILT_IMAGE_NAME }} --tag ${{ env.FULL_IMAGE_TO_PUSH_W_TAG }}:${{ env.TAG_TO_PUSH }} --push .

0 comments on commit 692f2df

Please sign in to comment.