Skip to content
107 changes: 38 additions & 69 deletions .github/workflows/deploy_helm_chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ on:
jobs:
diff:
runs-on: ubuntu-latest
if: ${{ !contains(format('{0}/{1}', 'refs/heads', inputs.deploy_branch ), github.ref ) }}
# if: ${{ !contains(format('{0}/{1}', 'refs/heads', inputs.deploy_branch ), github.ref ) }}
environment: ${{ inputs.environment }}
permissions:
contents: read
Expand Down Expand Up @@ -333,43 +333,28 @@ jobs:
echo "LAST_COMMIT_MSG=$LAST_COMMIT_MSG" >> $GITHUB_ENV

- name: Send notification
uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 #3.0.1
id: send_notification
if: ${{ fromJson( inputs.slack_notification_enabled ) }}
with:
channel-id: ${{ inputs.slack_channel_id }}
method: 'chat.postMessage'
token: ${{ secrets.slack_token }}
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${{ inputs.chart_name }} ${{ inputs.environment }} deployment started (In Progress)",
"emoji": true
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Status:*\n:large_yellow_square: In Progress"
},
{
"type": "mrkdwn",
"text": "*Last Commit Message:*\n${{ env.LAST_COMMIT_MSG }}"
},
{
"type": "mrkdwn",
"text": "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.slack_token }}
channel: ${{ inputs.slack_channel_id }}
blocks:
- type: "header"
text:
type: "plain_text"
text: "${{ inputs.chart_name }} ${{ inputs.environment }} deployment started (In Progress)"
emoji: true
- type: "section"
fields:
- type: "mrkdwn"
text: "*Status:*\n:large_yellow_square: In Progress"
- type: "mrkdwn"
text: "*Last Commit Message:*\n${{ env.LAST_COMMIT_MSG }}"
- type: "mrkdwn"
text: "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>"

- name: Deploy Helm
uses: bitovi/github-actions-deploy-eks-helm@29f556cf128eb1b42f834caf13b60a630ee2a20b # v1.2.12
Expand Down Expand Up @@ -419,40 +404,24 @@ jobs:

- name: Update notification
if: ${{ always() && fromJson( inputs.slack_notification_enabled ) }}
uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 #3.0.1
with:
channel-id: ${{ inputs.slack_channel_id }}
update-ts: ${{ steps.send_notification.outputs.ts }}
method: 'chat.update'
token: ${{ secrets.slack_token }}
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${{ inputs.chart_name }} ${{ inputs.environment }} deployment finished (Completed)",
"emoji": true
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Status:*\n${{ steps.deploy.outcome == 'success' && ':white_check_mark: Success' || ':x: Failure '}}"
},
{
"type": "mrkdwn",
"text": "*Last Commit Message:*\n${{ env.LAST_COMMIT_MSG }}"
},
{
"type": "mrkdwn",
"text": "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.slack_token }}

channel: ${{ inputs.slack_channel_id }}
ts: ${{ steps.send_notification.outputs.ts }}
blocks:
- type: "header"
text:
type: "plain_text"
text: "${{ inputs.chart_name }} ${{ inputs.environment }} deployment finished (Completed)"
emoji: true
- type: "section"
fields:
- type: "mrkdwn"
text: "*Status:*\n${{ steps.deploy.outcome == 'success' && ':white_check_mark: Success' || ':x: Failure '}}"
- type: "mrkdwn"
text: "*Last Commit Message:*\n${{ env.LAST_COMMIT_MSG }}"
- type: "mrkdwn"
text: "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>"
Loading