From 11ca554e1fc40a3e1d847e032fb3839b660c0f50 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:05:55 +0700 Subject: [PATCH 01/22] s --- .github/workflows/build-deploy.yml | 22 ++++++++++++++++ .github/workflows/send-message.yml | 42 ++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/send-message.yml diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 1417200..891f511 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -91,3 +91,25 @@ jobs: with: repository: isd-sgcu/rpkm67-devops github_token: ${{ secrets.RPKM67_DEVOPS_TOKEN }} + + # send_message: + # needs: cd + # runs-on: ubuntu-latest + + # steps: + # - name: Send message to Discord + # run: | + # curl -X POST -H "Content-Type: application/json" \ + # -d "{ + # \"content\": \"A new push has been made to the main branch by ${{ github.actor }}!\", + # \"embeds\": [ + # { + # \"author\": { + # \"name\": \"${{ github.actor }}\", + # \"icon_url\": \"https://github.com/${{ github.actor }}.png\" + # }, + # \"description\": \"Commit message: ${{ github.event.head_commit.message }}\" + # } + # ] + # }" \ + # ${{ secrets.DISCORD_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml new file mode 100644 index 0000000..1221228 --- /dev/null +++ b/.github/workflows/send-message.yml @@ -0,0 +1,42 @@ +name: Build + +on: + workflow_dispatch: + pull_request: + types: + - closed + branches: + - main + - dev + push: + branches: + - main + - dev + - send-message + +env: + SERVICE_NAME: rpkm67-gateway + IMAGE_NAME: ghcr.io/${{ github.repository }} + IMAGE_TAG: + +jobs: + send_message: + runs-on: ubuntu-latest + + steps: + - name: Send message to Discord + run: | + curl -X POST -H "Content-Type: application/json" \ + -d "{ + \"content\": \"A new push has been made to the main branch by ${{ github.actor }}!\", + \"embeds\": [ + { + \"author\": { + \"name\": \"${{ github.actor }}\", + \"icon_url\": \"https://github.com/${{ github.actor }}.png\" + }, + \"description\": \"Commit message: ${{ github.event.head_commit.message }}\" + } + ] + }" \ + ${{ secrets.DISCORD_WEBHOOK_URL }} \ No newline at end of file From f570772746267bd6f1910c26ccdb1b4fc27767ef Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:09:47 +0700 Subject: [PATCH 02/22] add auth --- .github/workflows/send-message.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index 1221228..e6be136 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -27,6 +27,7 @@ jobs: - 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 main branch by ${{ github.actor }}!\", \"embeds\": [ @@ -39,4 +40,4 @@ jobs: } ] }" \ - ${{ secrets.DISCORD_WEBHOOK_URL }} \ No newline at end of file + ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} \ No newline at end of file From 94111135e4f8751e9b691674a983c320e301f886 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:12:59 +0700 Subject: [PATCH 03/22] fix --- .github/workflows/send-message.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index e6be136..df21a7e 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -29,14 +29,14 @@ jobs: 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 main branch by ${{ github.actor }}!\", + \"content\": \"A new push has been made to the ${{ github.ref_name }} branch by ${{ github.actor }}!\", \"embeds\": [ { \"author\": { \"name\": \"${{ github.actor }}\", \"icon_url\": \"https://github.com/${{ github.actor }}.png\" }, - \"description\": \"Commit message: ${{ github.event.head_commit.message }}\" + \"description\": \"PR: ${{ github.event.pull_request.title }}\" } ] }" \ From d39eec350dd5352501ae94f5ebc4e34858a21374 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:14:08 +0700 Subject: [PATCH 04/22] branch --- .github/workflows/send-message.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index df21a7e..44f43c6 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -29,7 +29,7 @@ jobs: 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.ref_name }} branch by ${{ github.actor }}!\", + \"content\": \"A new push has been made to the ${{ github.event.pull_request.base.ref }} branch by ${{ github.actor }}!\", \"embeds\": [ { \"author\": { From 76abe9236216e168e05f76dd929caa5205ed71d9 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:16:16 +0700 Subject: [PATCH 05/22] fix --- .github/workflows/build-deploy.yml | 23 +---------------------- .github/workflows/send-message.yml | 3 ++- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 891f511..d541c70 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -91,25 +91,4 @@ jobs: with: repository: isd-sgcu/rpkm67-devops github_token: ${{ secrets.RPKM67_DEVOPS_TOKEN }} - - # send_message: - # needs: cd - # runs-on: ubuntu-latest - - # steps: - # - name: Send message to Discord - # run: | - # curl -X POST -H "Content-Type: application/json" \ - # -d "{ - # \"content\": \"A new push has been made to the main branch by ${{ github.actor }}!\", - # \"embeds\": [ - # { - # \"author\": { - # \"name\": \"${{ github.actor }}\", - # \"icon_url\": \"https://github.com/${{ github.actor }}.png\" - # }, - # \"description\": \"Commit message: ${{ github.event.head_commit.message }}\" - # } - # ] - # }" \ - # ${{ secrets.DISCORD_WEBHOOK_URL }} \ No newline at end of file + \ No newline at end of file diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index 44f43c6..0f011f0 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -12,7 +12,8 @@ on: branches: - main - dev - - send-message + tags: + - v* env: SERVICE_NAME: rpkm67-gateway From c5d84226fbdbd6004684dbff4c3a05eaaee9e005 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:28:30 +0700 Subject: [PATCH 06/22] try --- .github/workflows/build-deploy.yml | 7 +++++++ .github/workflows/send-message.yml | 29 ++++++++--------------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index d541c70..f4f853e 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -15,6 +15,13 @@ env: IMAGE_TAG: jobs: + send_message: + uses: ./.github/workflows/send-message.yml + secrets: + inherit: true + with: + service_name: ${{ env.SERVICE_NAME }} + build: name: Build runs-on: ubuntu-latest diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index 0f011f0..92f0f93 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -1,24 +1,7 @@ -name: Build +name: Send Messages 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: + workflow_call: jobs: send_message: @@ -30,14 +13,18 @@ jobs: 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 }}!\", + \"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 }}\" + \"description\": \"**Service Name:** ${{ inputs.service_name }}\n\n + **Details:**\n${ + inputs.commit_message || inputs.pr_title + }\", + \"color\": 5814783 } ] }" \ From 5b28c945bb35bf34f100fb0e19726a12236ba0ba Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:29:18 +0700 Subject: [PATCH 07/22] add push --- .github/workflows/build-deploy.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index f4f853e..104bdb6 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -8,6 +8,10 @@ on: branches: - main - dev + push: + branches: + - main + - dev env: SERVICE_NAME: rpkm67-gateway From 4475dfd0aa09096a329449e29f60277d942ffa47 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:34:39 +0700 Subject: [PATCH 08/22] s --- .github/workflows/build-deploy.yml | 4 ++-- .github/workflows/send-message.yml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 104bdb6..7d21f62 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -21,10 +21,10 @@ env: jobs: send_message: uses: ./.github/workflows/send-message.yml - secrets: - inherit: true with: service_name: ${{ env.SERVICE_NAME }} + secrets: + inherit: true build: name: Build diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index 92f0f93..65f643f 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -2,6 +2,11 @@ name: Send Messages on: workflow_call: + inputs: + service_name: + description: 'The name of the service' + required: true + type: string jobs: send_message: From 34cd4ca99c015612fc9e0ae5a816efdf14c5eb8e Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:39:11 +0700 Subject: [PATCH 09/22] fix --- .github/workflows/build-deploy.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 7d21f62..c1161fb 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -20,11 +20,12 @@ env: jobs: send_message: - uses: ./.github/workflows/send-message.yml - with: - service_name: ${{ env.SERVICE_NAME }} - secrets: - inherit: true + name: Send Messages + runs-on: ubuntu-latest + steps: + - uses: ./.github/workflows/send-message.yml + with: + service_name: ${{ env.SERVICE_NAME }} build: name: Build From 57bb2cf574f5f7d083c92e70c10f02735f4c91a8 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:45:28 +0700 Subject: [PATCH 10/22] d --- .github/workflows/build-deploy.yml | 7 +------ .github/workflows/send-message.yml | 13 ++++--------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index c1161fb..71038ba 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -20,12 +20,7 @@ env: jobs: send_message: - name: Send Messages - runs-on: ubuntu-latest - steps: - - uses: ./.github/workflows/send-message.yml - with: - service_name: ${{ env.SERVICE_NAME }} + uses: ./.github/workflows/send-message.yml build: name: Build diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index 65f643f..b596d7c 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -2,11 +2,6 @@ name: Send Messages on: workflow_call: - inputs: - service_name: - description: 'The name of the service' - required: true - type: string jobs: send_message: @@ -25,10 +20,10 @@ jobs: \"name\": \"${{ github.actor }}\", \"icon_url\": \"https://github.com/${{ github.actor }}.png\" }, - \"description\": \"**Service Name:** ${{ inputs.service_name }}\n\n - **Details:**\n${ - inputs.commit_message || inputs.pr_title - }\", + \"description\": \"**Service Name:** ${{ github.repository }}\n\n + **Details:**\n + ${{ github.event.pull_request.title || '' }} + \", \"color\": 5814783 } ] From afe2f8e76c875b5a81e8dcf95bb51c0da33b8586 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:48:11 +0700 Subject: [PATCH 11/22] fix --- .github/workflows/build-deploy.yml | 9 ++++++++- .github/workflows/send-message.yml | 13 +++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 71038ba..eb50017 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -20,7 +20,14 @@ env: jobs: send_message: - uses: ./.github/workflows/send-message.yml + name: Send Messages + runs-on: ubuntu-latest + + steps: + - uses: ./.github/workflows/send-message.yml + with: + webhook_url: ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} + discord_api_key: ${{ secrets.RPKM67_DISCORD_API_KEY }} build: name: Build diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index b596d7c..156fe7a 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -2,6 +2,15 @@ name: Send Messages on: workflow_call: + inputs: + webhook_url: + description: 'The webhook URL of the Discord channel' + required: true + type: string + discord_api_key: + description: 'The API key of the Discord bot' + required: true + type: string jobs: send_message: @@ -11,7 +20,7 @@ jobs: - name: Send message to Discord run: | curl -X POST -H "Content-Type: application/json" \ - -H "Authorization: Bot ${{ secrets.RPKM67_DISCORD_API_KEY }}" \ + -H "Authorization: Bot ${{ inputs.discord_api_key }}" \ -d "{ \"content\": \"A new push has been made to the **${{ github.event.pull_request.base.ref }}** branch by ${{ github.actor }}!\", \"embeds\": [ @@ -28,4 +37,4 @@ jobs: } ] }" \ - ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} \ No newline at end of file + ${{ inputs.webhook_url }} \ No newline at end of file From a9cfe89e8fec97647c7fe9cbc6043b686ec57231 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:51:13 +0700 Subject: [PATCH 12/22] add co --- .github/workflows/build-deploy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index eb50017..39b4bc5 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -24,7 +24,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: ./.github/workflows/send-message.yml + - name: Check out repository + uses: actions/checkout@v4 + - name: Send message to Discord + uses: ./.github/workflows/send-message.yml with: webhook_url: ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} discord_api_key: ${{ secrets.RPKM67_DISCORD_API_KEY }} From 970459f00901cbfd1489a262bab7c421db9b221a Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:52:26 +0700 Subject: [PATCH 13/22] remove .yml --- .github/workflows/build-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 39b4bc5..ba95dcc 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -27,7 +27,7 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - name: Send message to Discord - uses: ./.github/workflows/send-message.yml + uses: ./.github/workflows/send-message with: webhook_url: ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} discord_api_key: ${{ secrets.RPKM67_DISCORD_API_KEY }} From 6910c27aae4379c042396b52a4855ee4931e815b Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:55:29 +0700 Subject: [PATCH 14/22] inherit secret --- .github/workflows/build-deploy.yml | 25 ++++++++++++++----------- .github/workflows/send-message.yml | 13 ++----------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index ba95dcc..9be7335 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -20,17 +20,20 @@ env: jobs: send_message: - name: Send Messages - runs-on: ubuntu-latest - - steps: - - name: Check out repository - uses: actions/checkout@v4 - - name: Send message to Discord - uses: ./.github/workflows/send-message - with: - webhook_url: ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} - discord_api_key: ${{ secrets.RPKM67_DISCORD_API_KEY }} + # name: Send Messages + # runs-on: ubuntu-latest + + # steps: + # - name: Check out repository + # uses: actions/checkout@v4 + # - name: Send message to Discord + uses: ./.github/workflows/send-message.yml + secrets: inherit + # DISCORD_WEBHOOK_URL: ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} + # DISCORD_API_KEY: ${{ secrets.RPKM67_DISCORD_API_KEY }} + # with: + # webhook_url: ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} + # discord_api_key: ${{ secrets.RPKM67_DISCORD_API_KEY }} build: name: Build diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index 156fe7a..33e4cd2 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -2,15 +2,6 @@ name: Send Messages on: workflow_call: - inputs: - webhook_url: - description: 'The webhook URL of the Discord channel' - required: true - type: string - discord_api_key: - description: 'The API key of the Discord bot' - required: true - type: string jobs: send_message: @@ -20,7 +11,7 @@ jobs: - name: Send message to Discord run: | curl -X POST -H "Content-Type: application/json" \ - -H "Authorization: Bot ${{ inputs.discord_api_key }}" \ + -H "Authorization: Bot ${{ secrets.DISCORD_API_KEY }}" \ -d "{ \"content\": \"A new push has been made to the **${{ github.event.pull_request.base.ref }}** branch by ${{ github.actor }}!\", \"embeds\": [ @@ -37,4 +28,4 @@ jobs: } ] }" \ - ${{ inputs.webhook_url }} \ No newline at end of file + ${{ secrets.DISCORD_WEBHOOK_URL }} \ No newline at end of file From bf3915623097c5111e6822f54dca11ef9a507807 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:56:16 +0700 Subject: [PATCH 15/22] fix --- .github/workflows/send-message.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index 33e4cd2..b596d7c 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -11,7 +11,7 @@ jobs: - name: Send message to Discord run: | curl -X POST -H "Content-Type: application/json" \ - -H "Authorization: Bot ${{ secrets.DISCORD_API_KEY }}" \ + -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\": [ @@ -28,4 +28,4 @@ jobs: } ] }" \ - ${{ secrets.DISCORD_WEBHOOK_URL }} \ No newline at end of file + ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} \ No newline at end of file From 43641463287c2dc0c9e8ff5c9fa6b888e0f6dd79 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:56:36 +0700 Subject: [PATCH 16/22] remove comment --- .github/workflows/build-deploy.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 9be7335..bdebdb3 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -20,21 +20,9 @@ env: jobs: send_message: - # name: Send Messages - # runs-on: ubuntu-latest - - # steps: - # - name: Check out repository - # uses: actions/checkout@v4 - # - name: Send message to Discord uses: ./.github/workflows/send-message.yml secrets: inherit - # DISCORD_WEBHOOK_URL: ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} - # DISCORD_API_KEY: ${{ secrets.RPKM67_DISCORD_API_KEY }} - # with: - # webhook_url: ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} - # discord_api_key: ${{ secrets.RPKM67_DISCORD_API_KEY }} - + build: name: Build runs-on: ubuntu-latest From 8011a342d5adc7c3710c1a3d3f8cc875823a13c3 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 01:01:08 +0700 Subject: [PATCH 17/22] d --- .github/workflows/build-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index bdebdb3..5fcd4a6 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -12,6 +12,7 @@ on: branches: - main - dev + - send-message env: SERVICE_NAME: rpkm67-gateway From 25d54c3641f91519ba5521207f3ce7b7a2701481 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 01:03:18 +0700 Subject: [PATCH 18/22] s --- .github/workflows/send-message.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index b596d7c..29b26c7 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -20,10 +20,7 @@ jobs: \"name\": \"${{ github.actor }}\", \"icon_url\": \"https://github.com/${{ github.actor }}.png\" }, - \"description\": \"**Service Name:** ${{ github.repository }}\n\n - **Details:**\n - ${{ github.event.pull_request.title || '' }} - \", + \"description\": \"**Service Name:** ${{ github.repository }}\n\n**Details:**\n${{ github.event.pull_request.title || '' }}\", \"color\": 5814783 } ] From 100e7bb4a10cd0006dd8d49ceaf5a00c835ced39 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 01:04:37 +0700 Subject: [PATCH 19/22] sdf --- .github/workflows/send-message.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index 29b26c7..16097f0 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -20,7 +20,7 @@ jobs: \"name\": \"${{ github.actor }}\", \"icon_url\": \"https://github.com/${{ github.actor }}.png\" }, - \"description\": \"**Service Name:** ${{ github.repository }}\n\n**Details:**\n${{ github.event.pull_request.title || '' }}\", + \"description\": \"**Service Name:** ${{ github.repository }}\n\n**Details:**\n${{ github.event.pull_request.title || github.head_ref }}\", \"color\": 5814783 } ] From d4fbede2297a1ea1a41c52c3a02ce3394ee6263e Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 01:05:22 +0700 Subject: [PATCH 20/22] afgr --- .github/workflows/send-message.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index 16097f0..e0ad51e 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -20,7 +20,7 @@ jobs: \"name\": \"${{ github.actor }}\", \"icon_url\": \"https://github.com/${{ github.actor }}.png\" }, - \"description\": \"**Service Name:** ${{ github.repository }}\n\n**Details:**\n${{ github.event.pull_request.title || github.head_ref }}\", + \"description\": \"**Service Name:** ${{ github.repository }}\n\n**Details:**\n${{ github.event.pull_request.title || github.event.head_commit.message }}\", \"color\": 5814783 } ] From 77dde2bc63d59953bee7066005ca8dd35a13e21f Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 01:11:12 +0700 Subject: [PATCH 21/22] dfg --- .github/workflows/build-deploy.yml | 11 +++++++---- .github/workflows/send-message.yml | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 5fcd4a6..c25b7e9 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -20,10 +20,6 @@ env: IMAGE_TAG: jobs: - send_message: - uses: ./.github/workflows/send-message.yml - secrets: inherit - build: name: Build runs-on: ubuntu-latest @@ -70,6 +66,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 diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index e0ad51e..d199c24 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -2,6 +2,10 @@ name: Send Messages on: workflow_call: + inputs: + IMAGE_TAG: + required: true + type: string jobs: send_message: From 60fa04d153bd3f81e598eda9e669e95ce1f948bd Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 01:13:13 +0700 Subject: [PATCH 22/22] imput --- .github/workflows/send-message.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index d199c24..ff35264 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -24,7 +24,7 @@ jobs: \"name\": \"${{ github.actor }}\", \"icon_url\": \"https://github.com/${{ github.actor }}.png\" }, - \"description\": \"**Service Name:** ${{ github.repository }}\n\n**Details:**\n${{ github.event.pull_request.title || github.event.head_commit.message }}\", + \"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 } ]