Skip to content

Commit

Permalink
Merge pull request #46 from isd-sgcu/send-message
Browse files Browse the repository at this point in the history
send deployment message to discord
  • Loading branch information
bookpanda authored Jul 21, 2024
2 parents 127a3ff + 76abe92 commit 3e4ed5f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ jobs:
with:
repository: isd-sgcu/rpkm67-devops
github_token: ${{ secrets.RPKM67_DEVOPS_TOKEN }}

44 changes: 44 additions & 0 deletions .github/workflows/send-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build

on:
workflow_dispatch:
pull_request:
types:
- closed
branches:
- main
- dev
push:
branches:
- main
- dev
tags:
- v*

env:
SERVICE_NAME: rpkm67-gateway
IMAGE_NAME: ghcr.io/${{ github.repository }}
IMAGE_TAG: <WILL_BE_SET>

jobs:
send_message:
runs-on: ubuntu-latest

steps:
- name: Send message to Discord
run: |
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bot ${{ secrets.RPKM67_DISCORD_API_KEY }}" \
-d "{
\"content\": \"A new push has been made to the ${{ github.event.pull_request.base.ref }} branch by ${{ github.actor }}!\",
\"embeds\": [
{
\"author\": {
\"name\": \"${{ github.actor }}\",
\"icon_url\": \"https://github.com/${{ github.actor }}.png\"
},
\"description\": \"PR: ${{ github.event.pull_request.title }}\"
}
]
}" \
${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }}

0 comments on commit 3e4ed5f

Please sign in to comment.