Skip to content

Commit b7d5bc0

Browse files
Parameterize WAF and EXP inputs in deployment workflow
1 parent f55ce07 commit b7d5bc0

1 file changed

Lines changed: 18 additions & 36 deletions

File tree

.github/workflows/deploy-unified.yml

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,36 @@
1-
name: Deploy-Test-Cleanup (Unified)
1+
name: Deploy-Test-Cleanup (Parameterized)
22

33
on:
44
push:
55
branches:
66
- deploy-azd-waf
7-
workflow_run:
8-
workflows: ["Build Docker and Optional Push - Client Advisor"]
9-
types:
10-
- completed
11-
branches:
12-
- main
13-
- hotfix
14-
- dev
15-
- demo
167
workflow_dispatch:
178
inputs:
189
waf_enabled:
1910
description: 'Enable WAF (Well-Architected Framework) deployment'
2011
required: false
21-
default: 'false'
22-
type: choice
23-
options:
24-
- 'true'
25-
- 'false'
12+
default: false
13+
type: boolean
2614
EXP:
27-
description: 'Enable EXP features'
15+
description: 'Enable EXP'
2816
required: false
29-
default: 'false'
30-
type: choice
31-
options:
32-
- 'true'
33-
- 'false'
17+
default: false
18+
type: boolean
3419
cleanup_resources:
3520
description: 'Cleanup deployed resources after testing'
3621
required: false
37-
default: 'true'
38-
type: choice
39-
options:
40-
- 'true'
41-
- 'false'
22+
default: true
23+
type: boolean
4224
schedule:
4325
- cron: "0 6,18 * * *" # Runs at 6:00 AM and 6:00 PM GMT
4426

4527
env:
4628
GPT_MIN_CAPACITY: 150
4729
TEXT_EMBEDDING_MIN_CAPACITY: 80
4830
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.head_ref || github.ref_name }}
49-
WAF_ENABLED: ${{ github.event.inputs.waf_enabled || 'false' }}
50-
EXP: ${{ github.event.inputs.EXP || 'false' }}
51-
CLEANUP_RESOURCES: ${{ github.event.inputs.cleanup_resources || 'true' }}
31+
WAF_ENABLED: ${{ github.event.inputs.waf_enabled || false }}
32+
EXP: ${{ github.event.inputs.EXP || false }}
33+
CLEANUP_RESOURCES: ${{ github.event.inputs.cleanup_resources || true }}
5234

5335
jobs:
5436
deploy:
@@ -59,9 +41,9 @@ jobs:
5941
ENV_NAME: ${{ steps.generate_env_name.outputs.ENV_NAME }}
6042
AZURE_LOCATION: ${{ steps.set_region.outputs.AZURE_LOCATION }}
6143
env:
62-
WAF_ENABLED: ${{ github.event.inputs.waf_enabled || 'true' }}
63-
EXP: ${{ github.event.inputs.EXP || 'false' }}
64-
CLEANUP_RESOURCES: ${{ github.event.inputs.cleanup_resources || 'true' }}
44+
WAF_ENABLED: ${{ github.event.inputs.waf_enabled || true }}
45+
EXP: ${{ github.event.inputs.EXP || false }}
46+
CLEANUP_RESOURCES: ${{ github.event.inputs.cleanup_resources || true }}
6547

6648
steps:
6749
- name: Checkout Code
@@ -335,7 +317,7 @@ jobs:
335317
secrets: inherit
336318

337319
cleanup-deployment:
338-
if: always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && (github.event.inputs.cleanup_resources == 'true' || github.event.inputs.cleanup_resources == null)
320+
if: always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && (github.event.inputs.cleanup_resources == true || github.event.inputs.cleanup_resources == null)
339321
needs: [deploy, e2e-test]
340322
runs-on: ubuntu-latest
341323
env:
@@ -385,9 +367,9 @@ jobs:
385367
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
386368
387369
# Get deployment configuration for notification
388-
WAF_STATUS="${{ github.event.inputs.waf_enabled || 'true' }}"
389-
EXP_STATUS="${{ github.event.inputs.EXP || 'false' }}"
390-
CLEANUP_STATUS="${{ github.event.inputs.cleanup_resources || 'true' }}"
370+
WAF_STATUS="${{ github.event.inputs.waf_enabled || true }}"
371+
EXP_STATUS="${{ github.event.inputs.EXP || false }}"
372+
CLEANUP_STATUS="${{ github.event.inputs.cleanup_resources || true }}"
391373
392374
# Construct the email body
393375
EMAIL_BODY=$(cat <<EOF

0 commit comments

Comments
 (0)