diff --git a/.github/workflows/deploy-v2.yml b/.github/workflows/deploy-v2.yml
new file mode 100644
index 000000000..58b0e3a10
--- /dev/null
+++ b/.github/workflows/deploy-v2.yml
@@ -0,0 +1,346 @@
+name: Validate Deployment v2
+
+on:
+ workflow_run:
+ workflows: ["Build Docker and Optional Push"]
+ types:
+ - completed
+ branches:
+ - macae-v2
+ - dev
+ schedule:
+ - cron: "0 11,23 * * *" # Runs at 11:00 AM and 11:00 PM GMT
+ workflow_dispatch: #Allow manual triggering
+env:
+ GPT_MIN_CAPACITY: 150
+ BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ outputs:
+ RESOURCE_GROUP_NAME: ${{ steps.check_create_rg.outputs.RESOURCE_GROUP_NAME }}
+ WEBAPP_URL: ${{ steps.get_output.outputs.WEBAPP_URL }}
+ DEPLOYMENT_SUCCESS: ${{ steps.deployment_status.outputs.SUCCESS }}
+ MACAE_URL_API: ${{ steps.get_backend_url.outputs.MACAE_URL_API }}
+ CONTAINER_APP: ${{steps.get_backend_url.outputs.CONTAINER_APP}}
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v3
+
+ - name: Run Quota Check
+ id: quota-check
+ run: |
+ export AZURE_CLIENT_ID=${{ secrets.AZURE_CLIENT_ID }}
+ export AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}
+ export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}
+ export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
+ export GPT_MIN_CAPACITY="150"
+ export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
+
+ chmod +x infra/scripts/checkquota.sh
+ if ! infra/scripts/checkquota.sh; then
+ # If quota check fails due to insufficient quota, set the flag
+ if grep -q "No region with sufficient quota found" infra/scripts/checkquota.sh; then
+ echo "QUOTA_FAILED=true" >> $GITHUB_ENV
+ fi
+ exit 1 # Fail the pipeline if any other failure occurs
+ fi
+
+ - name: Send Notification on Quota Failure
+ if: env.QUOTA_FAILED == 'true'
+ run: |
+ RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
+ EMAIL_BODY=$(cat <
The quota check has failed, and the pipeline cannot proceed.
Build URL: ${RUN_URL}
Please take necessary action.
Best regards,
Your Automation Team
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.
Build URL: ${RUN_URL}
${OUTPUT}
Please investigate the matter at your earliest convenience.
Best regards,
Your Automation Team
The quota check has failed, and the pipeline cannot proceed.
Build URL: ${RUN_URL}
Please take necessary action.
Best regards,
Your Automation Team
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.
Build URL: ${RUN_URL}
${OUTPUT}
Please investigate the matter at your earliest convenience.
Best regards,
Your Automation Team
Please bake 12 chocolate chip cookies for tomorrow's event.
-