Skip to content

Commit

Permalink
Merge pull request #13 from isd-sgcu/dev
Browse files Browse the repository at this point in the history
wf add message
  • Loading branch information
bookpanda authored Jul 22, 2024
2 parents 35667b7 + 6439d39 commit 7ace272
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ APP_ENV=development
STORE_ENDPOINT=
STORE_ACCESS_KEY=
STORE_SECRET_KEY=
STORE_REGION=
STORE_USE_SSL=
STORE_BUCKET_NAME=
10 changes: 9 additions & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- dev

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

Expand Down Expand Up @@ -61,6 +61,13 @@ jobs:
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max

send_message:
needs: build
uses: ./.github/workflows/send-message.yml
secrets: inherit
with:
IMAGE_TAG: ${{ needs.build.outputs.IMAGE_TAG }}

cd:
name: Continuous Deployment
needs: build
Expand Down Expand Up @@ -91,3 +98,4 @@ jobs:
with:
repository: isd-sgcu/rpkm67-devops
github_token: ${{ secrets.RPKM67_DEVOPS_TOKEN }}

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

on:
workflow_call:
inputs:
IMAGE_TAG:
required: true
type: string

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\": \"**Service Name:** ${{ github.repository }}\n\n**Version:**\n${{ inputs.IMAGE_TAG }}\n\n**Details:**\n${{ github.event.pull_request.title || github.event.head_commit.message }}\",
\"color\": 5814783
}
]
}" \
${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion internal/object/object.repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (t *ObjectRepositoryTest) SetupTest() {
CDNEndpoint: "https://mock-cdn-endpoint",
}
t.controller = gomock.NewController(t.T())
t.mockEndpoint = "https://mock-cdn-endpoint/bucket/object"
t.mockEndpoint = "https://mock-cdn-endpoint/object"
}

func (t *ObjectRepositoryTest) TestCreateObjectSuccess() {
Expand Down

0 comments on commit 7ace272

Please sign in to comment.