Skip to content

Commit

Permalink
testing automation flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashant-Microsoft committed Aug 30, 2024
1 parent 707a9e3 commit 848f4bf
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/deploy-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,28 @@ jobs:
- name: Deploy Bicep Template
id: deploy
run: |
set -e
error_file=$(mktemp)
output=$(az deployment sub create \
output_file=$(mktemp)
az deployment sub create \
--name autoDemo \
--location eastus \
--template-file infra/main.bicep \
--parameters environmentName=pslautomation location=eastus2 2> "$error_file")
--parameters environmentName=pslautomation location=eastus2 \
&> "$output_file"
output=$(cat "$output_file")
echo "$output"
- name: Send Email
echo "output=$output" >> $GITHUB_ENV
rm "$output_file"
- name: Send Success Email
if: ${{ success() }}
run: echo "Deployment succeeded" | mail -s "Azure Deployment Success" v-pmalusare@microsoft.com

- name: Send Failure Email
if: ${{ failure() }}
run: |
status=${{ steps.deploy.outputs.status }}
output=${{ steps.deploy.outputs.output }}
if [ "$status" == "succeeded" ]; then
echo "Deployment succeeded. Details: $output" | mail -s "Azure Deployment Success" v-pmalusare@microsoft.com
else
echo "Deployment failed. Error details: $output" | mail -s "Azure Deployment Failure" v-pmalusare@microsoft.com
fi
output="${{ env.output }}"
echo "CWYD Deployment failed: $output" | mail -s "Azure Deployment Failure" v-pmalusare@microsoft.com

0 comments on commit 848f4bf

Please sign in to comment.