Skip to content

Commit e10aa37

Browse files
ci: integrate deployment and test automation workflow
2 parents f151593 + 9844255 commit e10aa37

File tree

10 files changed

+383
-155
lines changed

10 files changed

+383
-155
lines changed

.github/workflows/deploy-waf.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Validate WAF Deployment
1+
name: Validate WAF Deployment
22

33
on:
44
push:
55
branches:
66
- main
77
schedule:
8-
- cron: '0 11,23 * * *' # Runs at 11:00 AM and 11:00 PM GMT
8+
- cron: "0 11,23 * * *" # Runs at 11:00 AM and 11:00 PM GMT
99

1010
jobs:
1111
deploy:
@@ -55,7 +55,7 @@ jobs:
5555
- name: Set Deployment Region
5656
run: |
5757
echo "Selected Region: $VALID_REGION"
58-
echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
58+
echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
5959
6060
- name: Setup Azure CLI
6161
run: |
@@ -77,8 +77,7 @@ jobs:
7777
SHORT_UUID=$(uuidgen | cut -d'-' -f1)
7878
UNIQUE_RG_NAME="arg-${ACCL_NAME}-${SHORT_UUID}"
7979
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
80-
echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}"
81-
80+
echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}"
8281
8382
- name: Check and Create Resource Group
8483
id: check_create_rg
@@ -93,7 +92,6 @@ jobs:
9392
echo "Resource group already exists."
9493
fi
9594
96-
9795
- name: Deploy Bicep Template
9896
id: deploy
9997
run: |
@@ -113,29 +111,28 @@ jobs:
113111
if: failure()
114112
run: |
115113
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
116-
114+
117115
# Construct the email body
118116
EMAIL_BODY=$(cat <<EOF
119117
{
120118
"body": "<p>Dear Team,</p><p>We would like to inform you that the Multi-Agent-Custom-Automation-Engine-Solution-Accelerator Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Build URL:</strong> ${RUN_URL}<br> ${OUTPUT}</p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>"
121119
}
122120
EOF
123121
)
124-
122+
125123
# Send the notification
126124
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
127125
-H "Content-Type: application/json" \
128126
-d "$EMAIL_BODY" || echo "Failed to send notification"
129-
130-
127+
131128
- name: Get OpenAI Resource from Resource Group
132129
id: get_openai_resource
133130
run: |
134131
135132
136133
set -e
137134
echo "Fetching OpenAI resource from resource group ${{ env.RESOURCE_GROUP_NAME }}..."
138-
135+
139136
# Run the az resource list command to get the OpenAI resource name
140137
openai_resource_name=$(az resource list --resource-group ${{ env.RESOURCE_GROUP_NAME }} --resource-type "Microsoft.CognitiveServices/accounts" --query "[0].name" -o tsv)
141138
@@ -147,9 +144,6 @@ jobs:
147144
echo "OpenAI resource name: ${openai_resource_name}"
148145
fi
149146
150-
151-
152-
153147
- name: Delete Bicep Deployment
154148
if: always()
155149
run: |
@@ -167,11 +161,10 @@ jobs:
167161
echo "Resource group does not exists."
168162
fi
169163
170-
171164
- name: Wait for resource deletion to complete
172165
run: |
173166
174-
167+
175168
# Add resources to the array
176169
resources_to_check=("${{ env.OPENAI_RESOURCE_NAME }}")
177170
@@ -219,7 +212,6 @@ jobs:
219212
fi
220213
done
221214
222-
223215
- name: Purging the Resources
224216
if: always()
225217
run: |

0 commit comments

Comments
 (0)