Skip to content

Commit 4116ec2

Browse files
testing automation flow
1 parent d36079f commit 4116ec2

File tree

1 file changed

+51
-52
lines changed

1 file changed

+51
-52
lines changed

.github/workflows/deploy.yml

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ jobs:
3030
echo "Generating a unique resource group name..."
3131
TIMESTAMP=$(date +%Y%m%d%H%M%S)
3232
COMMON_PART="ci-biab"
33-
# UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}"
34-
UNIQUE_RG_NAME="psl-biab-manual2"
33+
UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}"
3534
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
3635
echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}"
3736
@@ -44,39 +43,39 @@ jobs:
4443
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
4544
if [ "$rg_exists" = "false" ]; then
4645
echo "Resource group does not exist. Creating..."
47-
az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus2 || { echo "Error creating resource group"; exit 1; }
46+
az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; }
4847
else
4948
echo "Resource group already exists."
5049
fi
5150
5251
53-
# - name: Deploy Bicep Template
54-
# id: deploy
55-
# run: |
56-
# set -e
57-
# az deployment group create \
58-
# --resource-group ${{ env.RESOURCE_GROUP_NAME }} \
59-
# --template-file deploy/macae.bicep \
60-
# --parameters azureOpenAILocation=eastus2 cosmosLocation=eastus2
52+
- name: Deploy Bicep Template
53+
id: deploy
54+
run: |
55+
set -e
56+
az deployment group create \
57+
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
58+
--template-file deploy/macae.bicep \
59+
--parameters azureOpenAILocation=eastus cosmosLocation=eastus
6160
6261
63-
# - name: Send Notification on Failure
64-
# if: failure()
65-
# run: |
66-
# RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
62+
- name: Send Notification on Failure
63+
if: failure()
64+
run: |
65+
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
6766
68-
# # Construct the email body
69-
# EMAIL_BODY=$(cat <<EOF
70-
# {
71-
# "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>"
72-
# }
73-
# EOF
74-
# )
67+
# Construct the email body
68+
EMAIL_BODY=$(cat <<EOF
69+
{
70+
"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>"
71+
}
72+
EOF
73+
)
7574

76-
# # Send the notification
77-
# curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
78-
# -H "Content-Type: application/json" \
79-
# -d "$EMAIL_BODY" || echo "Failed to send notification"
75+
# Send the notification
76+
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
77+
-H "Content-Type: application/json" \
78+
-d "$EMAIL_BODY" || echo "Failed to send notification"
8079

8180

8281
- name: Get OpenAI, App Service and Container Registry Resource from Resource Group
@@ -125,32 +124,32 @@ jobs:
125124
fi
126125
127126
128-
# - name: Build the image and update the container app
129-
# id: build-and-update
130-
# run: |
131-
132-
# set -e
133-
# # Define variables for acr and container app names
134-
# acr_name="${{ env.ACR_NAME }}"
135-
# echo "ACR name: {$acr_name}"
136-
# backend_container_app_name="macae-backend"
137-
# backend_build_image_tag="backend:latest"
138-
139-
# echo "Building the container image..."
140-
# # Build the image
141-
# az acr build -r ${acr_name} -t ${backend_build_image_tag} ./src/backend
142-
# echo "Backend image build completed successfully."
143-
144-
# frontend_container_app_name="${{ env.APP_SERVICE_NAME }}"
145-
# frontend_build_image_tag="frontend:latest"
146-
147-
# echo "Building the container image..."
148-
# # Build the image
149-
# az acr build -r ${acr_name} -t ${frontend_build_image_tag} ./src/frontend
150-
# echo "Frontend image build completed successfully."
151-
152-
# # Add the new container to the website
153-
# az webapp config container set --resource-group ${{ env.RESOURCE_GROUP_NAME }} --name ${frontend_container_app_name} --container-image-name ${acr_name}.azurecr.io/frontend:latest --container-registry-url https://${acr_name}.azurecr.io
127+
- name: Build the image and update the container app
128+
id: build-and-update
129+
run: |
130+
131+
set -e
132+
# Define variables for acr and container app names
133+
acr_name="${{ env.ACR_NAME }}"
134+
echo "ACR name: {$acr_name}"
135+
backend_container_app_name="macae-backend"
136+
backend_build_image_tag="backend:latest"
137+
138+
echo "Building the container image..."
139+
# Build the image
140+
az acr build -r ${acr_name} -t ${backend_build_image_tag} ./src/backend
141+
echo "Backend image build completed successfully."
142+
143+
frontend_container_app_name="${{ env.APP_SERVICE_NAME }}"
144+
frontend_build_image_tag="frontend:latest"
145+
146+
echo "Building the container image..."
147+
# Build the image
148+
az acr build -r ${acr_name} -t ${frontend_build_image_tag} ./src/frontend
149+
echo "Frontend image build completed successfully."
150+
151+
# Add the new container to the website
152+
az webapp config container set --resource-group ${{ env.RESOURCE_GROUP_NAME }} --name ${frontend_container_app_name} --container-image-name ${acr_name}.azurecr.io/frontend:latest --container-registry-url https://${acr_name}.azurecr.io
154153
155154
156155
- name: Delete Bicep Deployment

0 commit comments

Comments
 (0)