WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 026e796

Browse files
ci: add workflow dispatch input for deployment type selection
1 parent 6b8ca0c commit 026e796

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/CAdeploy.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ on:
99
- hb-psl-update-e2eworkflow
1010
schedule:
1111
- cron: "0 6 * * *" # Runs at 6:00 AM UTC daily
12+
workflow_dispatch:
13+
inputs:
14+
DEPLOYMENT_TYPE:
15+
description: 'Specify deployment type: WAF or Non-WAF'
16+
required: false
17+
type: choice
18+
options:
19+
- WAF
20+
- Non-WAF
21+
default: 'Non-WAF'
1222

1323
env:
1424
GPT_MIN_CAPACITY: 200
@@ -24,6 +34,7 @@ jobs:
2434
DEPLOYMENT_SUCCESS: ${{ steps.deployment_status.outputs.SUCCESS }}
2535
AZURE_LOCATION: ${{ steps.set_region.outputs.AZURE_LOCATION }}
2636
ENV_NAME: ${{ steps.generate_env_name.outputs.ENV_NAME }}
37+
DEPLOYMENT_TYPE: ${{ steps.determine_deployment_type.outputs.DEPLOYMENT_TYPE }}
2738

2839
steps:
2940
- name: Checkout
@@ -155,6 +166,15 @@ jobs:
155166
# Remove leading zero
156167
DAY=$((10#$DAY))
157168
169+
# Check if deployment type is provided via workflow dispatch
170+
if [ "${{ github.event.inputs.DEPLOYMENT_TYPE }}" != "" ]; then
171+
DEPLOYMENT_TYPE="${{ github.event.inputs.DEPLOYMENT_TYPE }}"
172+
echo "DEPLOYMENT_TYPE=$DEPLOYMENT_TYPE" >> $GITHUB_OUTPUT
173+
echo "DEPLOYMENT_TYPE=$DEPLOYMENT_TYPE" >> $GITHUB_ENV
174+
echo "Deployment type provided via workflow dispatch: $DEPLOYMENT_TYPE"
175+
exit 0
176+
fi
177+
158178
# Alternate based on odd/even day
159179
if [ $((DAY % 2)) -eq 0 ]; then
160180
echo "DEPLOYMENT_TYPE=WAF" >> $GITHUB_OUTPUT
@@ -337,6 +357,7 @@ jobs:
337357
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
338358
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
339359
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
360+
DEPLOYMENT_TYPE: ${{ needs.deploy.outputs.DEPLOYMENT_TYPE }}
340361
steps:
341362
- name: Setup Azure CLI
342363
run: |
@@ -387,7 +408,7 @@ jobs:
387408
# Construct the email body
388409
EMAIL_BODY=$(cat <<EOF
389410
{
390-
"body": "<p>Dear Team,</p><p>We would like to inform you that the Build-your-own-copilot-Solution-Accelerator(Client Advisior) Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Build URL:</strong> ${RUN_URL}<br> ${OUTPUT}</p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>"
411+
"body": "<p>Dear Team,</p><p>We would like to inform you that the Build-your-own-copilot-Solution-Accelerator(Client Advisior) - ${{ env.DEPLOYMENT_TYPE }} Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Build URL:</strong> ${RUN_URL}<br> ${OUTPUT}</p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>"
391412
}
392413
EOF
393414
)

0 commit comments

Comments
 (0)