44 push :
55 branches :
66 - main
7+ - fix-deploy-pipeline
78 schedule :
89 - cron : ' 0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT
910
@@ -122,15 +123,23 @@ jobs:
122123 --parameters AzureOpenAILocation=${{ env.AZURE_LOCATION }} environmentName=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 gptDeploymentCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} \
123124
124125 - name : Get AI Services name and store in variable
126+ if : steps.check_create_rg.outcome == 'success'
125127 id : get_ai_services_name
126128 run : |
127129 set -e
128130 echo "Getting AI Services name..."
129- # Get the AI Services name from the deployment output
131+ # Get the AI Services name
130132 ai_services_name=$(az cognitiveservices account list -g ${{ env.RESOURCE_GROUP_NAME }} --query "[0].name" -o tsv)
131- echo "AI_SERVICES_NAME=${ai_services_name}" >> $GITHUB_ENV
133+ if [ -z "$ai_services_name" ]; then
134+ echo "No AI Services resource found in the resource group."
135+ echo "AI_SERVICES_NAME=" >> $GITHUB_ENV
136+ else
137+ echo "AI_SERVICES_NAME=${ai_services_name}" >> $GITHUB_ENV
138+ echo "Found AI Services resource: $ai_services_name"
139+ fi
132140
133141 - name : List KeyVaults and Store in Array
142+ if : steps.check_create_rg.outcome == 'success'
134143 id : list_keyvaults
135144 run : |
136145
@@ -184,7 +193,7 @@ jobs:
184193 # echo "Power BI URL updated successfully for application: $application_name."
185194
186195 - name : Delete Bicep Deployment
187- if : always()
196+ if : steps.check_create_rg.outcome == 'success'
188197 run : |
189198 set -e
190199 echo "Checking if resource group exists..."
@@ -201,6 +210,7 @@ jobs:
201210 fi
202211
203212 - name : Wait for resource deletion to complete
213+ if : steps.check_create_rg.outcome == 'success'
204214 run : |
205215
206216 # List of keyvaults
@@ -260,7 +270,7 @@ jobs:
260270 done
261271
262272 - name : Purging the Resources
263- if : success()
273+ if : steps.check_create_rg.outcome == ' success'
264274 run : |
265275
266276 set -e
0 commit comments