Skip to content

Commit 8ff5d39

Browse files
feat: Add new workflows for deployment, cleanup, and testing
- Implemented `deploy-windows.yml` for Windows deployment with customizable inputs. - Created `job-cleanup-deployment.yml` for resource cleanup after deployment. - Added `job-deploy-linux.yml` for Linux deployment with Docker image handling. - Developed `job-deploy-windows.yml` for Windows deployment with Docker image support. - Introduced `job-deploy.yml` to select deployment OS and orchestrate Linux/Windows jobs. - Established `job-docker-build.yml` for building and pushing Docker images. - Created `job-send-notification.yml` for sending deployment notifications based on results. - Implemented `test-automation-v2.yml` for running end-to-end tests with reporting.
1 parent 6e1bae7 commit 8ff5d39

10 files changed

+1199
-0
lines changed

.github/workflows/deploy-linux.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Deploy-Test-Cleanup (v2) Linux
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_run:
8+
workflows: ["Build Docker and Optional Push"]
9+
types:
10+
- completed
11+
branches:
12+
- main
13+
- dev
14+
- demo
15+
workflow_dispatch:
16+
inputs:
17+
azure_location:
18+
description: 'Azure Location For Deployment'
19+
required: false
20+
default: 'australiaeast'
21+
type: choice
22+
options:
23+
- 'australiaeast'
24+
- 'centralus'
25+
- 'eastasia'
26+
- 'eastus'
27+
- 'eastus2'
28+
- 'japaneast'
29+
- 'northeurope'
30+
- 'southeastasia'
31+
- 'uksouth'
32+
resource_group_name:
33+
description: 'Resource Group Name (Optional)'
34+
required: false
35+
default: ''
36+
type: string
37+
waf_enabled:
38+
description: 'Enable WAF'
39+
required: false
40+
default: false
41+
type: boolean
42+
EXP:
43+
description: 'Enable EXP'
44+
required: false
45+
default: false
46+
type: boolean
47+
build_docker_image:
48+
description: 'Build And Push Docker Image (Optional)'
49+
required: false
50+
default: false
51+
type: boolean
52+
cleanup_resources:
53+
description: 'Cleanup Deployed Resources'
54+
required: false
55+
default: false
56+
type: boolean
57+
run_e2e_tests:
58+
description: 'Run End-to-End Tests'
59+
required: false
60+
default: 'GoldenPath-Testing'
61+
type: choice
62+
options:
63+
- 'GoldenPath-Testing'
64+
- 'Smoke-Testing'
65+
- 'None'
66+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
67+
description: 'Log Analytics Workspace ID (Optional)'
68+
required: false
69+
default: ''
70+
type: string
71+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID:
72+
description: 'AI Project Resource ID (Optional)'
73+
required: false
74+
default: ''
75+
type: string
76+
existing_webapp_url:
77+
description: 'Existing WebApp URL (Skips Deployment)'
78+
required: false
79+
default: ''
80+
type: string
81+
schedule:
82+
- cron: '0 9,21 * * *' # Runs at 9:00 AM and 9:00 PM GMT
83+
84+
jobs:
85+
Run:
86+
uses: ./.github/workflows/deploy-orchestrator.yml
87+
with:
88+
runner_os: ubuntu-latest
89+
azure_location: ${{ github.event.inputs.azure_location || 'australiaeast' }}
90+
resource_group_name: ${{ github.event.inputs.resource_group_name || '' }}
91+
waf_enabled: ${{ github.event.inputs.waf_enabled == 'true' }}
92+
EXP: ${{ github.event.inputs.EXP == 'true' }}
93+
build_docker_image: ${{ github.event.inputs.build_docker_image == 'true' }}
94+
cleanup_resources: ${{ github.event.inputs.cleanup_resources == 'true' }}
95+
run_e2e_tests: ${{ github.event.inputs.run_e2e_tests || 'GoldenPath-Testing' }}
96+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ github.event.inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID || '' }}
97+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID || '' }}
98+
existing_webapp_url: ${{ github.event.inputs.existing_webapp_url || '' }}
99+
trigger_type: ${{ github.event_name }}
100+
secrets: inherit
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Deployment orchestrator
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner_os:
7+
description: 'Runner OS (ubuntu-latest or windows-latest)'
8+
required: true
9+
type: string
10+
azure_location:
11+
description: 'Azure Location For Deployment'
12+
required: false
13+
default: 'australiaeast'
14+
type: string
15+
resource_group_name:
16+
description: 'Resource Group Name (Optional)'
17+
required: false
18+
default: ''
19+
type: string
20+
waf_enabled:
21+
description: 'Enable WAF'
22+
required: false
23+
default: false
24+
type: boolean
25+
EXP:
26+
description: 'Enable EXP'
27+
required: false
28+
default: false
29+
type: boolean
30+
build_docker_image:
31+
description: 'Build And Push Docker Image (Optional)'
32+
required: false
33+
default: false
34+
type: boolean
35+
cleanup_resources:
36+
description: 'Cleanup Deployed Resources'
37+
required: false
38+
default: false
39+
type: boolean
40+
run_e2e_tests:
41+
description: 'Run End-to-End Tests'
42+
required: false
43+
default: 'GoldenPath-Testing'
44+
type: string
45+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
46+
description: 'Log Analytics Workspace ID (Optional)'
47+
required: false
48+
default: ''
49+
type: string
50+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID:
51+
description: 'AI Project Resource ID (Optional)'
52+
required: false
53+
default: ''
54+
type: string
55+
existing_webapp_url:
56+
description: 'Existing Container WebApp URL (Skips Deployment)'
57+
required: false
58+
default: ''
59+
type: string
60+
trigger_type:
61+
description: 'Trigger type (workflow_dispatch, pull_request, schedule, push)'
62+
required: true
63+
type: string
64+
65+
env:
66+
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
67+
68+
jobs:
69+
docker-build:
70+
uses: ./.github/workflows/job-docker-build.yml
71+
with:
72+
trigger_type: ${{ inputs.trigger_type }}
73+
build_docker_image: ${{ inputs.build_docker_image }}
74+
secrets: inherit
75+
76+
deploy:
77+
if: always() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)
78+
needs: docker-build
79+
uses: ./.github/workflows/job-deploy.yml
80+
with:
81+
runner_os: ${{ inputs.runner_os }}
82+
azure_location: ${{ inputs.azure_location }}
83+
resource_group_name: ${{ inputs.resource_group_name }}
84+
waf_enabled: ${{ inputs.waf_enabled }}
85+
EXP: ${{ inputs.EXP }}
86+
build_docker_image: ${{ inputs.build_docker_image }}
87+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
88+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}
89+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
90+
docker_image_tag: ${{ needs.docker-build.outputs.IMAGE_TAG }}
91+
run_e2e_tests: ${{ inputs.run_e2e_tests }}
92+
cleanup_resources: ${{ inputs.cleanup_resources }}
93+
secrets: inherit
94+
95+
e2e-test:
96+
if: always() && ((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))
97+
needs: [docker-build, deploy]
98+
uses: ./.github/workflows/test-automation-v2.yml
99+
with:
100+
DOCGEN_URL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
101+
TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
102+
secrets: inherit
103+
104+
send-notification:
105+
if: always()
106+
needs: [docker-build, deploy, e2e-test]
107+
uses: ./.github/workflows/job-send-notification.yml
108+
with:
109+
trigger_type: ${{ inputs.trigger_type }}
110+
waf_enabled: ${{ inputs.waf_enabled }}
111+
EXP: ${{ inputs.EXP }}
112+
run_e2e_tests: ${{ inputs.run_e2e_tests }}
113+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
114+
deploy_result: ${{ needs.deploy.result }}
115+
e2e_test_result: ${{ needs.e2e-test.result }}
116+
WEB_APPURL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
117+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
118+
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
119+
TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
120+
TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
121+
secrets: inherit
122+
123+
cleanup-deployment:
124+
if: always() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)
125+
needs: [docker-build, deploy, e2e-test]
126+
uses: ./.github/workflows/job-cleanup-deployment.yml
127+
with:
128+
runner_os: ${{ inputs.runner_os }}
129+
trigger_type: ${{ inputs.trigger_type }}
130+
cleanup_resources: ${{ inputs.cleanup_resources }}
131+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
132+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
133+
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
134+
AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
135+
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
136+
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
137+
secrets: inherit
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Deploy-Test-Cleanup (v2) Windows
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
azure_location:
7+
description: 'Azure Location For Deployment'
8+
required: false
9+
default: 'australiaeast'
10+
type: choice
11+
options:
12+
- 'australiaeast'
13+
- 'centralus'
14+
- 'eastasia'
15+
- 'eastus2'
16+
- 'japaneast'
17+
- 'northeurope'
18+
- 'southeastasia'
19+
- 'uksouth'
20+
resource_group_name:
21+
description: 'Resource Group Name (Optional)'
22+
required: false
23+
default: ''
24+
type: string
25+
waf_enabled:
26+
description: 'Enable WAF'
27+
required: false
28+
default: false
29+
type: boolean
30+
EXP:
31+
description: 'Enable EXP'
32+
required: false
33+
default: false
34+
type: boolean
35+
build_docker_image:
36+
description: 'Build And Push Docker Image (Optional)'
37+
required: false
38+
default: false
39+
type: boolean
40+
cleanup_resources:
41+
description: 'Cleanup Deployed Resources'
42+
required: false
43+
default: false
44+
type: boolean
45+
run_e2e_tests:
46+
description: 'Run End-to-End Tests'
47+
required: false
48+
default: 'GoldenPath-Testing'
49+
type: choice
50+
options:
51+
- 'GoldenPath-Testing'
52+
- 'Smoke-Testing'
53+
- 'None'
54+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
55+
description: 'Log Analytics Workspace ID (Optional)'
56+
required: false
57+
default: ''
58+
type: string
59+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID:
60+
description: 'AI Project Resource ID (Optional)'
61+
required: false
62+
default: ''
63+
type: string
64+
existing_webapp_url:
65+
description: 'Existing WebApp URL (Skips Deployment)'
66+
required: false
67+
default: ''
68+
type: string
69+
70+
jobs:
71+
Run:
72+
uses: ./.github/workflows/deploy-orchestrator.yml
73+
with:
74+
runner_os: windows-latest
75+
azure_location: ${{ github.event.inputs.azure_location || 'australiaeast' }}
76+
resource_group_name: ${{ github.event.inputs.resource_group_name || '' }}
77+
waf_enabled: ${{ github.event.inputs.waf_enabled == 'true' }}
78+
EXP: ${{ github.event.inputs.EXP == 'true' }}
79+
build_docker_image: ${{ github.event.inputs.build_docker_image == 'true' }}
80+
cleanup_resources: ${{ github.event.inputs.cleanup_resources == 'true' }}
81+
run_e2e_tests: ${{ github.event.inputs.run_e2e_tests || 'GoldenPath-Testing' }}
82+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ github.event.inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID || '' }}
83+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID || '' }}
84+
existing_webapp_url: ${{ github.event.inputs.existing_webapp_url || '' }}
85+
trigger_type: ${{ github.event_name }}
86+
secrets: inherit

0 commit comments

Comments
 (0)