fix: adding slack notification when build is failed to upload to docker (#2862)

* fix: removing logs

* fix: adding slack notification when build is failed to upload to docker

* minor changes

---------

Co-authored-by: Manish Gupta <59428681+manishg3@users.noreply.github.com>
This commit is contained in:
sriram veeraghanta 2023-11-24 12:17:31 +05:30 committed by GitHub
parent 97be4b60ae
commit 8d76c96a6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 177 additions and 19 deletions

View File

@ -1,4 +1,3 @@
name: Branch Build name: Branch Build
on: on:
@ -41,22 +40,22 @@ jobs:
id: gh_branch_replace_slash id: gh_branch_replace_slash
with: with:
source: ${{ steps.gh_branch_upper_lower.outputs.lowercase }} source: ${{ steps.gh_branch_upper_lower.outputs.lowercase }}
find: '/' find: "/"
replace: '-' replace: "-"
- uses: mad9000/actions-find-and-replace-string@2 - uses: mad9000/actions-find-and-replace-string@2
id: gh_branch_replace_dot id: gh_branch_replace_dot
with: with:
source: ${{ steps.gh_branch_replace_slash.outputs.value }} source: ${{ steps.gh_branch_replace_slash.outputs.value }}
find: '.' find: "."
replace: '' replace: ""
- uses: mad9000/actions-find-and-replace-string@2 - uses: mad9000/actions-find-and-replace-string@2
id: gh_branch_clean id: gh_branch_clean
with: with:
source: ${{ steps.gh_branch_replace_dot.outputs.value }} source: ${{ steps.gh_branch_replace_dot.outputs.value }}
find: '_' find: "_"
replace: '' replace: ""
- name: Uploading Proxy Source - name: Uploading Proxy Source
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -77,7 +76,6 @@ jobs:
!./nginx !./nginx
!./deploy !./deploy
!./space !./space
- name: Uploading Space Source - name: Uploading Space Source
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -88,6 +86,38 @@ jobs:
!./nginx !./nginx
!./deploy !./deploy
!./web !./web
- name: Send GitHub Action trigger data to Slack workflow
if: ${{ job.status == 'success' }}
id: slackSuccess
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"repo_name": "${{ github.repository }}",
"redirect_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_name": "${{ github.workflow }}",
"job_name": "${{ github.job }}",
"status": "✅ ${{ job.status }}",
"message": "${{ github.event.head_commit.message }} "
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GITHUB_BUILD_WEBHOOK }}
- name: Send GitHub Action trigger data to Slack workflow
if: ${{ job.status == 'failure' }}
id: slackFailed
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"repo_name": "${{ github.repository }}",
"redirect_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_name": "${{ github.workflow }}",
"job_name": "${{ github.job }}",
"status": "❌ ${{ job.status }}",
"message": "${{ github.event.head_commit.message }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GITHUB_BUILD_WEBHOOK }}
outputs: outputs:
gh_branch_name: ${{ steps.gh_branch_clean.outputs.value }} gh_branch_name: ${{ steps.gh_branch_clean.outputs.value }}
@ -121,6 +151,39 @@ jobs:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Send GitHub Action trigger data to Slack workflow
if: ${{ job.status == 'success' }}
id: slackSuccess
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"repo_name": "${{ github.repository }}",
"redirect_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_name": "${{ github.workflow }}",
"job_name": "${{ github.job }}",
"status": "✅ ${{ job.status }}",
"message": "${{ github.event.head_commit.message }} "
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GITHUB_BUILD_WEBHOOK }}
- name: Send GitHub Action trigger data to Slack workflow
if: ${{ job.status == 'failure' }}
id: slackFailed
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"repo_name": "${{ github.repository }}",
"redirect_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_name": "${{ github.workflow }}",
"job_name": "${{ github.job }}",
"status": "❌ ${{ job.status }}",
"message": "${{ github.event.head_commit.message }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GITHUB_BUILD_WEBHOOK }}
branch_build_push_space: branch_build_push_space:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: [branch_build_and_push] needs: [branch_build_and_push]
@ -151,6 +214,38 @@ jobs:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Send GitHub Action trigger data to Slack workflow
if: ${{ job.status == 'success' }}
id: slackSuccess
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"repo_name": "${{ github.repository }}",
"redirect_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_name": "${{ github.workflow }}",
"job_name": "${{ github.job }}",
"status": "✅ ${{ job.status }}",
"message": "${{ github.event.head_commit.message }} "
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GITHUB_BUILD_WEBHOOK }}
- name: Send GitHub Action trigger data to Slack workflow
if: ${{ job.status == 'failure' }}
id: slackFailed
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"repo_name": "${{ github.repository }}",
"redirect_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_name": "${{ github.workflow }}",
"job_name": "${{ github.job }}",
"status": "❌ ${{ job.status }}",
"message": "${{ github.event.head_commit.message }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GITHUB_BUILD_WEBHOOK }}
branch_build_push_backend: branch_build_push_backend:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: [branch_build_and_push] needs: [branch_build_and_push]
@ -180,6 +275,38 @@ jobs:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Send GitHub Action trigger data to Slack workflow
if: ${{ job.status == 'success' }}
id: slackSuccess
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"repo_name": "${{ github.repository }}",
"redirect_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_name": "${{ github.workflow }}",
"job_name": "${{ github.job }}",
"status": "✅ ${{ job.status }}",
"message": "${{ github.event.head_commit.message }} "
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GITHUB_BUILD_WEBHOOK }}
- name: Send GitHub Action trigger data to Slack workflow
if: ${{ job.status == 'failure' }}
id: slackFailed
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"repo_name": "${{ github.repository }}",
"redirect_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_name": "${{ github.workflow }}",
"job_name": "${{ github.job }}",
"status": "❌ ${{ job.status }}",
"message": "${{ github.event.head_commit.message }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GITHUB_BUILD_WEBHOOK }}
branch_build_push_proxy: branch_build_push_proxy:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
@ -211,3 +338,35 @@ jobs:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Send GitHub Action trigger data to Slack workflow
if: ${{ job.status == 'success' }}
id: slackSuccess
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"repo_name": "${{ github.repository }}",
"redirect_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_name": "${{ github.workflow }}",
"job_name": "${{ github.job }}",
"status": "✅ ${{ job.status }}",
"message": "${{ github.event.head_commit.message }} "
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GITHUB_BUILD_WEBHOOK }}
- name: Send GitHub Action trigger data to Slack workflow
if: ${{ job.status == 'failure' }}
id: slackFailed
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"repo_name": "${{ github.repository }}",
"redirect_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_name": "${{ github.workflow }}",
"job_name": "${{ github.job }}",
"status": "❌ ${{ job.status }}",
"message": "${{ github.event.head_commit.message }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GITHUB_BUILD_WEBHOOK }}

View File

@ -112,7 +112,6 @@ export const IssueForm: FC<IssueFormProps> = observer((props) => {
appConfig: { envConfig }, appConfig: { envConfig },
} = useMobxStore(); } = useMobxStore();
const user = userStore.currentUser; const user = userStore.currentUser;
console.log("envConfig", envConfig);
// hooks // hooks
const editorSuggestion = useEditorSuggestions(); const editorSuggestion = useEditorSuggestions();
const { setToastAlert } = useToast(); const { setToastAlert } = useToast();