Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
38151c9
pipelines creation initial version v1
Rafi-Microsoft Dec 15, 2025
c31425c
removed linux reference
Rafi-Microsoft Dec 15, 2025
ebfd02f
fix v1
Rafi-Microsoft Dec 15, 2025
793bbb4
fix v2
Rafi-Microsoft Dec 15, 2025
e947d3e
post deployment fix
Rafi-Microsoft Dec 16, 2025
0daefc5
post dep fix v2
Rafi-Microsoft Dec 16, 2025
56ffec8
post dep fix v3
Rafi-Microsoft Dec 16, 2025
d6a39cb
pipeline fix v1
Rafi-Microsoft Dec 16, 2025
39fd71a
pipeline fix v2
Rafi-Microsoft Dec 16, 2025
14c9d00
fix v3
Rafi-Microsoft Dec 16, 2025
bd19179
fix v4
Rafi-Microsoft Dec 16, 2025
9cfa334
updated ai location
Rafi-Microsoft Dec 16, 2025
2f2fdfd
fix v5
Rafi-Microsoft Dec 16, 2025
bfd953c
added open ai location param
Rafi-Microsoft Dec 17, 2025
aa6108d
added docker logs
Rafi-Microsoft Dec 17, 2025
910ebc3
docker issue fix v1
Rafi-Microsoft Dec 17, 2025
cb4cfd1
post dep fix v1
Rafi-Microsoft Dec 17, 2025
34eeea2
fix v3
Rafi-Microsoft Dec 17, 2025
7750aa4
updated tokens
Rafi-Microsoft Dec 18, 2025
da53491
added exp and waf support
Rafi-Microsoft Dec 18, 2025
59fb40e
fix v1
Rafi-Microsoft Dec 18, 2025
601b650
code cleanup
Rafi-Microsoft Dec 18, 2025
1231dbb
code cleanup v2
Rafi-Microsoft Dec 18, 2025
4b1fa16
removed docker build file and code cleanup
Rafi-Microsoft Dec 18, 2025
bf2f244
fix v1
Rafi-Microsoft Dec 18, 2025
0c28294
e to e step fix
Rafi-Microsoft Dec 18, 2025
54f9fe9
updated output params
Rafi-Microsoft Dec 18, 2025
e75ff5f
added ai location param
Rafi-Microsoft Dec 19, 2025
8e85a0d
fixed copilot suggested fixes
Rafi-Microsoft Dec 22, 2025
d0cda0a
copilot fixes
Rafi-Microsoft Dec 22, 2025
52bfbca
renamed a param back to original
Rafi-Microsoft Dec 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/deploy-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Deploy-Test-Cleanup (v2)
on:
push:
branches:
- main # Adjust this to the branch you want to trigger the deployment on
- dev
- demo
schedule:
- cron: "0 10,22 * * *" # Runs at 10:00 AM and 10:00 PM GMT

workflow_dispatch:
inputs:
azure_location:
description: 'Azure Location For Deployment'
required: false
default: 'australiaeast'
type: choice
options:
- 'australiaeast'
- 'centralus'
- 'eastasia'
- 'eastus2'
- 'japaneast'
- 'northeurope'
- 'southeastasia'
- 'uksouth'
resource_group_name:
description: 'Resource Group Name (Optional)'
required: false
default: ''
type: string

waf_enabled:
description: 'Enable WAF'
required: false
default: false
type: boolean
EXP:
description: 'Enable EXP'
required: false
default: false
type: boolean

cleanup_resources:
description: 'Cleanup Deployed Resources'
required: false
default: false
type: boolean

run_e2e_tests:
description: 'Run End-to-End Tests'
required: false
default: 'GoldenPath-Testing'
type: choice
options:
- 'GoldenPath-Testing'
- 'Smoke-Testing'
- 'None'

AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
description: 'Log Analytics Workspace ID (Optional)'
required: false
default: ''
type: string
existing_webapp_url:
description: 'Existing WebApp URL (Skips Deployment)'
required: false
default: ''
type: string

jobs:
Run:
uses: ./.github/workflows/deploy-orchestrator.yml
with:
azure_location: ${{ github.event.inputs.azure_location || 'australiaeast' }}
resource_group_name: ${{ github.event.inputs.resource_group_name || '' }}
waf_enabled: ${{ github.event.inputs.waf_enabled == 'true' }}
EXP: ${{ github.event.inputs.EXP == 'true' }}
cleanup_resources: ${{ github.event.inputs.cleanup_resources == 'true' }}
run_e2e_tests: ${{ github.event.inputs.run_e2e_tests || 'GoldenPath-Testing' }}
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ github.event.inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID || '' }}
existing_webapp_url: ${{ github.event.inputs.existing_webapp_url || '' }}
trigger_type: ${{ github.event_name }}
secrets: inherit
111 changes: 111 additions & 0 deletions .github/workflows/deploy-orchestrator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Deployment orchestrator

on:
workflow_call:
inputs:
azure_location:
description: 'Azure Location For Deployment'
required: false
default: 'australiaeast'
type: string
resource_group_name:
description: 'Resource Group Name (Optional)'
required: false
default: ''
type: string
waf_enabled:
description: 'Enable WAF'
required: false
default: false
type: boolean
EXP:
description: 'Enable EXP'
required: false
default: false
type: boolean
cleanup_resources:
description: 'Cleanup Deployed Resources'
required: false
default: false
type: boolean
run_e2e_tests:
description: 'Run End-to-End Tests'
required: false
default: 'GoldenPath-Testing'
type: string
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
description: 'Log Analytics Workspace ID (Optional)'
required: false
default: ''
type: string
existing_webapp_url:
description: 'Existing Container WebApp URL (Skips Deployment)'
required: false
default: ''
type: string
trigger_type:
description: 'Trigger type (workflow_dispatch, pull_request, schedule)'
required: true
type: string

env:
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}

jobs:
deploy:
if: "!cancelled() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)"
uses: ./.github/workflows/job-deploy.yml
with:
trigger_type: ${{ inputs.trigger_type }}
azure_location: ${{ inputs.azure_location }}
resource_group_name: ${{ inputs.resource_group_name }}
waf_enabled: ${{ inputs.waf_enabled }}
EXP: ${{ inputs.EXP }}
existing_webapp_url: ${{ inputs.existing_webapp_url }}
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}
run_e2e_tests: ${{ inputs.run_e2e_tests }}
cleanup_resources: ${{ inputs.cleanup_resources }}
secrets: inherit

e2e-test:
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
needs: [deploy]
uses: ./.github/workflows/test-automation-v2.yml
with:
TEST_URL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
secrets: inherit

send-notification:
if: "!cancelled()"
needs: [deploy, e2e-test]
uses: ./.github/workflows/job-send-notification.yml
with:
trigger_type: ${{ inputs.trigger_type }}
waf_enabled: ${{ inputs.waf_enabled }}
EXP: ${{ inputs.EXP }}
run_e2e_tests: ${{ inputs.run_e2e_tests }}
existing_webapp_url: ${{ inputs.existing_webapp_url }}
deploy_result: ${{ needs.deploy.result }}
e2e_test_result: ${{ needs.e2e-test.result }}
WEB_APPURL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
secrets: inherit

cleanup-deployment:
if: "!cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
needs: [deploy, e2e-test]
uses: ./.github/workflows/job-cleanup-deployment.yml
with:
trigger_type: ${{ inputs.trigger_type }}
cleanup_resources: ${{ inputs.cleanup_resources }}
existing_webapp_url: ${{ inputs.existing_webapp_url }}
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
secrets: inherit
110 changes: 110 additions & 0 deletions .github/workflows/job-cleanup-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Cleanup Deployment Job
on:
workflow_call:
inputs:
trigger_type:
description: 'Trigger type (workflow_dispatch, pull_request, schedule)'
required: true
type: string
cleanup_resources:
description: 'Cleanup Deployed Resources'
required: false
default: false
type: boolean
existing_webapp_url:
description: 'Existing Container WebApp URL (Skips Deployment)'
required: false
default: ''
type: string
RESOURCE_GROUP_NAME:
description: 'Resource Group Name to cleanup'
required: true
type: string
AZURE_LOCATION:
description: 'Azure Location'
required: true
type: string
AZURE_ENV_OPENAI_LOCATION:
description: 'Azure OpenAI Location'
required: true
type: string
ENV_NAME:
description: 'Environment Name'
required: true
type: string
IMAGE_TAG:
description: 'Docker Image Tag'
required: true
type: string

jobs:
cleanup-deployment:
runs-on: ubuntu-latest
continue-on-error: true
env:
RESOURCE_GROUP_NAME: ${{ inputs.RESOURCE_GROUP_NAME }}
AZURE_LOCATION: ${{ inputs.AZURE_LOCATION }}
AZURE_ENV_OPENAI_LOCATION: ${{ inputs.AZURE_ENV_OPENAI_LOCATION }}
ENV_NAME: ${{ inputs.ENV_NAME }}
IMAGE_TAG: ${{ inputs.IMAGE_TAG }}
steps:
- name: Setup Azure CLI
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
fi
az --version

- name: Login to Azure
shell: bash
run: |
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Delete Resource Group (Optimized Cleanup)
id: delete_rg
shell: bash
run: |
set -e
echo "🗑️ Starting optimized resource cleanup..."
echo "Deleting resource group: ${{ env.RESOURCE_GROUP_NAME }}"

az group delete \
--name "${{ env.RESOURCE_GROUP_NAME }}" \
--yes \
--no-wait

echo "✅ Resource group deletion initiated (running asynchronously)"
echo "Note: Resources will be cleaned up in the background"

- name: Logout from Azure
if: always()
shell: bash
run: |
azd auth logout || true
az logout || echo "Warning: Failed to logout from Azure CLI"
echo "Logged out from Azure."

- name: Generate Cleanup Job Summary
if: always()
shell: bash
run: |
echo "## 🧹 Cleanup Job Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| **Resource Group deletion Status** | ${{ steps.delete_rg.outcome == 'success' && '✅ Initiated' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| **Resource Group** | \`${{ env.RESOURCE_GROUP_NAME }}\` |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.delete_rg.outcome }}" == "success" ]]; then
echo "### ✅ Cleanup Details" >> $GITHUB_STEP_SUMMARY
echo "- Successfully initiated deletion for Resource Group \`${{ env.RESOURCE_GROUP_NAME }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
else
echo "### ❌ Cleanup Failed" >> $GITHUB_STEP_SUMMARY
echo "- Cleanup process encountered an error" >> $GITHUB_STEP_SUMMARY
echo "- Manual cleanup may be required for:" >> $GITHUB_STEP_SUMMARY
echo " - Resource Group: \`${{ env.RESOURCE_GROUP_NAME }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Check the cleanup-deployment job logs for detailed error information" >> $GITHUB_STEP_SUMMARY
fi
Loading
Loading