Skip to content

Commit 5feae19

Browse files
Merge pull request #81 from microsoft/psl-Deployment-Pipeline-Integration
ci: Added Deployment v2 Workflow
2 parents 3589bee + 57b5106 commit 5feae19

14 files changed

Lines changed: 1415 additions & 5 deletions

.azuredevops/azure-pipeline-infrastructure.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ parameters:
2929
- name: tags
3030
displayName: Resource Tags
3131
type: object
32-
default:
33-
SecurityControl: 'Ignore'
32+
default: {}
3433
- name: enableMonitoring
3534
displayName: Enable Monitoring
3635
type: boolean

.github/workflows/deploy-linux.yml

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

0 commit comments

Comments
 (0)