Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CI Pipeline Notification handling #1

Merged
merged 27 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b12382a
testing automation flow
Prashant-Microsoft Sep 10, 2024
0dff2d1
testing automation flow
Prashant-Microsoft Sep 10, 2024
0be4ab2
testing automation flow
Prashant-Microsoft Sep 10, 2024
2e994ab
testing automation flow
Prashant-Microsoft Sep 10, 2024
f21bd53
testing automation flow
Prashant-Microsoft Sep 10, 2024
cc33ea6
testing automation flow
Prashant-Microsoft Sep 10, 2024
1673a58
testing automation flow
Prashant-Microsoft Sep 12, 2024
84c7c09
testing automation flow
Prashant-Microsoft Sep 12, 2024
2d5e386
testing automation flow
Prashant-Microsoft Sep 12, 2024
8027980
testing automation flow
Prashant-Microsoft Sep 30, 2024
34736f5
testing automation flow
Prashant-Microsoft Sep 30, 2024
e8264a5
testing automation flow
Prashant-Microsoft Sep 30, 2024
45f1a5e
testing automation flow
Prashant-Microsoft Oct 4, 2024
a9e31f7
testing automation flow
Prashant-Microsoft Oct 4, 2024
e4bf47b
modify code
Prashant-Microsoft Oct 8, 2024
00f50e1
testing automation flow
Prashant-Microsoft Oct 8, 2024
36b751b
testing automation flow
Prashant-Microsoft Oct 8, 2024
12bc1d7
testing automation flow
Prashant-Microsoft Oct 9, 2024
03e286f
testing automation flow
Prashant-Microsoft Oct 9, 2024
1434b3f
testing automation flow
Prashant-Microsoft Oct 9, 2024
4a34ac6
testing automation flow
Prashant-Microsoft Oct 9, 2024
50b52bc
added github container registry
Prashant-Microsoft Oct 10, 2024
29e31a9
testing automation flow
Prashant-Microsoft Oct 11, 2024
7c53203
testing automation flow
Prashant-Microsoft Oct 11, 2024
7c6de03
testing automation flow
Prashant-Microsoft Oct 16, 2024
ba9203e
modify code
Prashant-Microsoft Oct 17, 2024
af1a887
modify code
Prashant-Microsoft Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/bicep-audit.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Validate bicep templates
on:
push:
branches:
branches:
- main
paths:
- "**/*.bicep"
pull_request:
branches:
branches:
- main
paths:
- "**/*.bicep"
Expand All @@ -30,6 +30,6 @@ jobs:

- name: Upload alerts to Security tab
uses: github/codeql-action/upload-sarif@v3
if: github.repository_owner == 'Azure-Samples'
if: github.repository_owner == 'Roopan-Microsoft'
with:
sarif_file: ${{ steps.msdo.outputs.sarifFile }}
4 changes: 2 additions & 2 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
dockerfile: docker/Frontend.Dockerfile
uses: ./.github/workflows/build-docker.yml
with:
registry: fruoccopublic.azurecr.io
username: fruoccopublic
registry: pkcwydcontainerreg.azurecr.io
username: pkcwydcontainerreg
app_name: ${{ matrix.app_name }}
dockerfile: ${{ matrix.dockerfile }}
push: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' }}
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
AZURE_ENV_NAME: ${{ github.run_id }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
with:
imageName: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
cacheFrom: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
imageName: ghcr.io/roopan-microsoft/psl-cwyd-main
cacheFrom: ghcr.io/roopan-microsoft/psl-cwyd-main
runCmd: make ci && make deploy
refFilterForPush: refs/heads/main
env: |
Expand All @@ -58,7 +58,7 @@ jobs:
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
with:
push: never
imageName: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
imageName: ghcr.io/roopan-microsoft/psl-cwyd-main
runCmd: make destroy
env: |
AZURE_CLIENT_ID
Expand All @@ -67,3 +67,21 @@ jobs:
AZURE_SUBSCRIPTION_ID
AZURE_ENV_NAME
AZURE_LOCATION

- name: Send Notification on Failure
if: failure()
run: |
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"

# Construct the email body
EMAIL_BODY=$(cat <<EOF
{
"body": "<p>Dear Team,</p><p>We would like to inform you that the CWYD 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>"
}
EOF
)

# Send the notification
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
-H "Content-Type: application/json" \
-d "$EMAIL_BODY" || echo "Failed to send notification"
Loading