-
Notifications
You must be signed in to change notification settings - Fork 560
chore: notify Slack after frontend production deploy #8340
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
Merged
talissoncosta
merged 1 commit into
main
from
chore/add-slack-frontend-deploy-notification
Aug 24, 2026
+114
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| name: Notify Slack of a deploy | ||
| description: Post a deploy notification to a Slack incoming webhook, prompting a smoke test. | ||
|
|
||
| inputs: | ||
| webhook_url: | ||
| description: The Slack incoming webhook to post the notification to. | ||
| required: true | ||
| service: | ||
| description: The name of the deployed service, e.g. Frontend. | ||
| required: true | ||
| app_url: | ||
| description: The URL of the deployed application, linked from the notification. | ||
| required: true | ||
| environment: | ||
| description: The environment that was deployed to. | ||
| required: false | ||
| default: production | ||
|
|
||
| runs: | ||
| using: composite | ||
|
|
||
| steps: | ||
| - name: Post to Slack | ||
| shell: bash | ||
| env: | ||
| SLACK_WEBHOOK_URL: ${{ inputs.webhook_url }} | ||
| SERVICE: ${{ inputs.service }} | ||
| APP_URL: ${{ inputs.app_url }} | ||
| ENVIRONMENT: ${{ inputs.environment }} | ||
| COMMIT_SHA: ${{ github.sha }} | ||
| ACTOR: ${{ github.actor }} | ||
| WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
| # jq builds the payload so every value is escaped for us, rather than | ||
| # interpolated into a JSON heredoc. | ||
| run: | | ||
| jq -n \ | ||
| --arg service "$SERVICE" \ | ||
| --arg environment "$ENVIRONMENT" \ | ||
| --arg short_sha "${COMMIT_SHA:0:7}" \ | ||
| --arg actor "$ACTOR" \ | ||
| --arg app_url "$APP_URL" \ | ||
| --arg workflow_url "$WORKFLOW_URL" \ | ||
| '($environment | (.[0:1] | ascii_upcase) + .[1:]) as $env_name | | ||
| { | ||
| # Slack honours username on this webhook but ignores icon_emoji. | ||
| # The avatar comes from the icon set on the Slack app itself. | ||
| username: "\($service) Deploy", | ||
| text: "🚀 \($service) deployed to \($environment): smoke test required", | ||
| blocks: [ | ||
| { | ||
| type: "header", | ||
| text: { type: "plain_text", text: "🚀 \($service) deployed to \($environment)" } | ||
| }, | ||
| { | ||
| type: "section", | ||
| text: { | ||
| type: "mrkdwn", | ||
| text: "🧪 *\($env_name) smoke test required*\n\nPlease verify the application directly in \($environment)." | ||
| } | ||
| }, | ||
| { | ||
| type: "section", | ||
| fields: [ | ||
| { type: "mrkdwn", text: "*Commit:*\n\($short_sha)" }, | ||
| { type: "mrkdwn", text: "*Deployed by:*\n@\($actor)" } | ||
| ] | ||
| }, | ||
| { | ||
| type: "actions", | ||
| elements: [ | ||
| { | ||
| type: "button", | ||
| text: { type: "plain_text", text: "Open \($env_name)" }, | ||
| url: $app_url | ||
| }, | ||
| { | ||
| type: "button", | ||
| text: { type: "plain_text", text: "View GitHub Actions" }, | ||
| url: $workflow_url | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }' \ | ||
| | curl --fail-with-body --connect-timeout 10 --max-time 30 -X POST \ | ||
| -H 'Content-Type: application/json' \ | ||
| --data @- \ | ||
| "$SLACK_WEBHOOK_URL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.