From 003887d4e0340760670a8872e22d8dcab0ed6c93 Mon Sep 17 00:00:00 2001
From: Shruti Chaturvedi <66940685+ShrutiC-git@users.noreply.github.com>
Date: Mon, 6 Feb 2023 17:29:05 +0530
Subject: [PATCH] Use official Uffizzi reusable action (#1027)

* Use official Uffizzi reusable action

* Run preview if build passed successfully
---
 .github/workflows/uffizzi-preview.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/uffizzi-preview.yml b/.github/workflows/uffizzi-preview.yml
index a9b6e431..f4692cfb 100644
--- a/.github/workflows/uffizzi-preview.yml
+++ b/.github/workflows/uffizzi-preview.yml
@@ -11,6 +11,7 @@ on:
 jobs:
   cache-compose-file:
     name: Cache Compose File
+    if: ${{ github.event.workflow_run.conclusion == 'success' }}
     runs-on: ubuntu-latest
     outputs:
       compose-file-cache-key: ${{ env.HASH }}
@@ -70,9 +71,10 @@ jobs:
 
   deploy-uffizzi-preview:
     name: Use Remote Workflow to Preview on Uffizzi
+    if: ${{ github.event.workflow_run.conclusion == 'success' }}
     needs:
       - cache-compose-file
-    uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@check_pr_state
+    uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2
     with:
       # If this workflow was triggered by a PR close event, cache-key will be an empty string
       # and this reusable workflow will delete the preview deployment.