From 12a2cb11681e492984d0e1f5a57b0888c0e1f338 Mon Sep 17 00:00:00 2001 From: revopushbot Date: Fri, 10 Jul 2026 00:10:00 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'.github/'?= =?UTF-8?q?=20with=20remote=20'pages/.github/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-production.yml | 9 +++++++++ .github/workflows/deploy-staging.yml | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 1ba2fb7..97aa036 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -61,3 +61,12 @@ jobs: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} command: pages deploy dist --project-name ${{ vars.CLOUDFLARE_PAGES_PROJECT }} --branch=main + + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-deploy + with: + slack-webhook: ${{ secrets.SLACK_DEPLOY_WEBHOOK }} + status: ${{ job.status }} + environment: production + sha: ${{ steps.resolve.outputs.sha }} diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 4f1c8b5..d096cb2 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -39,3 +39,11 @@ jobs: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} command: pages deploy dist --project-name ${{ vars.CLOUDFLARE_PAGES_PROJECT }} --branch=main + + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-deploy + with: + slack-webhook: ${{ secrets.SLACK_DEPLOY_WEBHOOK }} + status: ${{ job.status }} + environment: staging From 343f5ea9dda87c4482e4b96392e401bdff4291cb Mon Sep 17 00:00:00 2001 From: revopushbot Date: Fri, 10 Jul 2026 00:10:00 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=84=20created=20local=20'.github/a?= =?UTF-8?q?ctions/notify-deploy/'=20from=20remote=20'actions/notify-deploy?= =?UTF-8?q?/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/notify-deploy/action.yml | 65 ++++++++++++++++++++++ .github/actions/notify-deploy/message.json | 33 +++++++++++ 2 files changed, 98 insertions(+) create mode 100644 .github/actions/notify-deploy/action.yml create mode 100644 .github/actions/notify-deploy/message.json diff --git a/.github/actions/notify-deploy/action.yml b/.github/actions/notify-deploy/action.yml new file mode 100644 index 0000000..eb60309 --- /dev/null +++ b/.github/actions/notify-deploy/action.yml @@ -0,0 +1,65 @@ +# Rich, best-effort Slack deploy/rollback notification. +# Canonical source in shared-workflows; synced into consumer repos as a local action. +# All presentation lives in message.json — a Block Kit template you can paste into +# app.slack.com/block-kit-builder. This action just wires inputs into env vars that the +# template reads (payload-templated substitutes + escapes them). Best-effort: never fails the job. +name: Notify deploy +description: Post a rich deployment/rollback status message to Slack. Best-effort — never fails the job. + +inputs: + slack-webhook: + description: Slack incoming webhook URL. If empty, the notification is skipped. + required: true + status: + description: "Job status: success | failure | cancelled (callers pass job.status)." + required: true + environment: + description: Deploy target environment (e.g. staging, production). + required: true + title: + description: Action noun shown in the header (Deploy | Rollback). + required: false + default: Deploy + version: + description: Component version/ref for the Version field. Defaults to the short commit sha. + required: false + default: "" + sha: + description: The commit actually deployed. Defaults to the workflow sha; pass the resolved sha for promotions. + required: false + default: ${{ github.sha }} + service-url: + description: Live service URL for the "Open " button. Defaults to the GitHub deployments page. + required: false + default: "" + changes-url: + description: Diff/compare URL for the "Changes" button. Defaults to the deployed commit. + required: false + default: "" + summary: + description: Extra mrkdwn appended under the header (e.g. a rollback worker/version table). Multi-line is safe. + required: false + default: "" + +runs: + using: composite + steps: + - name: Notify Slack + if: ${{ inputs.slack-webhook != '' }} + continue-on-error: true + uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3 + env: + SLACK_STATUS: ${{ inputs.status }} + SLACK_TITLE: ${{ inputs.title }} + SLACK_ENV: ${{ inputs.environment }} + SLACK_VERSION: ${{ inputs.version }} + SLACK_SHA: ${{ inputs.sha }} + SLACK_SERVICE_URL: ${{ inputs.service-url }} + SLACK_CHANGES_URL: ${{ inputs.changes-url }} + SLACK_SUMMARY: ${{ inputs.summary }} + with: + webhook: ${{ inputs.slack-webhook }} + webhook-type: incoming-webhook + errors: "false" + payload-file-path: ${{ github.action_path }}/message.json + payload-templated: true diff --git a/.github/actions/notify-deploy/message.json b/.github/actions/notify-deploy/message.json new file mode 100644 index 0000000..52cbcff --- /dev/null +++ b/.github/actions/notify-deploy/message.json @@ -0,0 +1,33 @@ +{ + "text": "{{env.SLACK_TITLE}} {{env.SLACK_STATUS}}: {{env.GITHUB_REPOSITORY}} ({{env.SLACK_ENV}})", + "attachments": [ + { + "color": "{{if env.SLACK_STATUS|equals>success}}#2eb67d{{else}}{{if env.SLACK_STATUS|equals>failure}}#e01e5a{{else}}#667085{{/if}}{{/if}}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "{{if env.SLACK_STATUS|equals>success}}✅{{else}}{{if env.SLACK_STATUS|equals>failure}}❌{{else}}⚪{{/if}}{{/if}} `{{env.GITHUB_REPOSITORY}}` · *{{env.SLACK_TITLE}} {{if env.SLACK_STATUS|equals>success}}succeeded{{else}}{{if env.SLACK_STATUS|equals>failure}}failed{{else}}{{env.SLACK_STATUS}}{{/if}}{{/if}}* · {{env.SLACK_ENV}}{{if env.SLACK_SUMMARY|notempty}}\n{{env.SLACK_SUMMARY}}{{/if}}" + } + }, + { + "type": "section", + "fields": [ + { "type": "mrkdwn", "text": "*Commit:*\n<{{env.GITHUB_SERVER_URL}}/{{env.GITHUB_REPOSITORY}}/commit/{{env.SLACK_SHA}}|`{{env.SLACK_SHA|limit>7}}`>" }, + { "type": "mrkdwn", "text": "*Triggered by:*\n<{{env.GITHUB_SERVER_URL}}/{{env.GITHUB_ACTOR}}|@{{env.GITHUB_ACTOR}}>" }, + { "type": "mrkdwn", "text": "*Version:*\n`{{if env.SLACK_VERSION|notempty}}{{env.SLACK_VERSION}}{{else}}{{env.SLACK_SHA|limit>7}}{{/if}}`" } + ] + }, + { + "type": "actions", + "elements": [ + { "type": "button", "text": { "type": "plain_text", "text": "CI run" }, "url": "{{env.GITHUB_SERVER_URL}}/{{env.GITHUB_REPOSITORY}}/actions/runs/{{env.GITHUB_RUN_ID}}" }, + { "type": "button", "text": { "type": "plain_text", "text": "Changes" }, "url": "{{if env.SLACK_CHANGES_URL|notempty}}{{env.SLACK_CHANGES_URL}}{{else}}{{env.GITHUB_SERVER_URL}}/{{env.GITHUB_REPOSITORY}}/commit/{{env.SLACK_SHA}}{{/if}}" }, + { "type": "button", "text": { "type": "plain_text", "text": "Open {{env.SLACK_ENV}}" }, "url": "{{if env.SLACK_SERVICE_URL|notempty}}{{env.SLACK_SERVICE_URL}}{{else}}{{env.GITHUB_SERVER_URL}}/{{env.GITHUB_REPOSITORY}}/deployments/{{env.SLACK_ENV}}{{/if}}", "style": "primary" } + ] + } + ] + } + ] +}