From eb3206bbfc618dfde8dc312c092c34d2488d242d Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 23 Sep 2025 18:11:36 +0300 Subject: [PATCH 01/34] change 2nd notify --- .github/workflows/deployk8s.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployk8s.yaml b/.github/workflows/deployk8s.yaml index 46e7da0..0ae071e 100644 --- a/.github/workflows/deployk8s.yaml +++ b/.github/workflows/deployk8s.yaml @@ -48,7 +48,7 @@ jobs: notify: needs: [deploy] if: always() - uses: HUB/workflows/.github/workflows/notify.yaml@main + uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD with: result: ${{ needs.deploy.result}} name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} From 44a12848a4f00794e66c3e96b151ae2875db09e5 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 23 Sep 2025 18:27:54 +0300 Subject: [PATCH 02/34] change --- .github/workflows/deployk8s.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deployk8s.yaml b/.github/workflows/deployk8s.yaml index 0ae071e..61d6e60 100644 --- a/.github/workflows/deployk8s.yaml +++ b/.github/workflows/deployk8s.yaml @@ -44,12 +44,10 @@ jobs: environment: ${{ inputs.environment }} tag: ${{ inputs.tag }} migrate: ${{ inputs.migrate }} - - notify: - needs: [deploy] - if: always() - uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD - with: - result: ${{ needs.deploy.result}} - name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} - secrets: inherit \ No newline at end of file + - name: post-notify + if: always() + uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD + with: + result: ${{ needs.deploy.result}} + name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} + secrets: inherit \ No newline at end of file From 3f7d7f3e7a37d456c613d31de60da84cb676341d Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 23 Sep 2025 18:34:03 +0300 Subject: [PATCH 03/34] new secrets politic --- .github/workflows/deployk8s.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployk8s.yaml b/.github/workflows/deployk8s.yaml index 61d6e60..d3f5d42 100644 --- a/.github/workflows/deployk8s.yaml +++ b/.github/workflows/deployk8s.yaml @@ -50,4 +50,4 @@ jobs: with: result: ${{ needs.deploy.result}} name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} - secrets: inherit \ No newline at end of file + secrets: ${{ toJSON(secrets) }} \ No newline at end of file From 5e878c74c52aac01459999510d161101f44e52a7 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 23 Sep 2025 18:52:58 +0300 Subject: [PATCH 04/34] change to step politic correct (i think) --- .github/workflows/deployk8s.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployk8s.yaml b/.github/workflows/deployk8s.yaml index d3f5d42..b7e621d 100644 --- a/.github/workflows/deployk8s.yaml +++ b/.github/workflows/deployk8s.yaml @@ -38,6 +38,7 @@ jobs: secrets: ${{ toJSON(secrets) }} name: deploy ${{ inputs.environment }} tag ${{ inputs.tag }} - name: deploy + id: k8s_deploy uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/k8s@HEAD with: secrets: ${{ toJSON(secrets) }} @@ -48,6 +49,6 @@ jobs: if: always() uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD with: - result: ${{ needs.deploy.result}} + result: ${{ steps.k8s_deploy.outcome }} name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} secrets: ${{ toJSON(secrets) }} \ No newline at end of file From 247c2595804a6962d27bad2442f5e2cbb7cff3e0 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 13 Oct 2025 14:13:50 +0300 Subject: [PATCH 05/34] new notify in build --- .github/workflows/notify.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/notify.yaml b/.github/workflows/notify.yaml index c37c31c..3b34cf8 100644 --- a/.github/workflows/notify.yaml +++ b/.github/workflows/notify.yaml @@ -1,5 +1,3 @@ -env: - icons: '{"success" : ":white_check_mark:", "failure": ":x:", "canceled": ":facepalm:", "started": ":warning:", "": ":boxing_glove:"}' on: workflow_call: inputs: @@ -15,11 +13,13 @@ jobs: notify: runs-on: gpu steps: - - uses: mattermost/action-mattermost-notify@master - with: - MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }} - PAYLOAD: | - { - "text": "${{ github.repository }} [${{inputs.name}}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}) was ${{ inputs.result }} by ${{ github.event.sender.login}} ${{ fromJson(env.icons)[inputs.result]}}" - } - + - uses: dosymep/vk-teams-action@v1.0.0 + env: + ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}' + with: + token: ${{ fromJSON(inputs.secrets).VK_TEAMS_BOT_TOKEN }} + to: ${{ fromJSON(inputs.secrets).VK_TEAMS_CHAT_ID }} + format: MarkdownV2 + message: | + ${{ github.repository }} \[${{inputs.name}}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ fromJson(env.ICONS)[inputs.result] }} + From d617b37876d440ed2dfab94acb5237ac806c49a6 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 13 Oct 2025 14:16:39 +0300 Subject: [PATCH 06/34] Change tok --- .github/workflows/notify.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notify.yaml b/.github/workflows/notify.yaml index 3b34cf8..d8d2170 100644 --- a/.github/workflows/notify.yaml +++ b/.github/workflows/notify.yaml @@ -17,8 +17,8 @@ jobs: env: ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}' with: - token: ${{ fromJSON(inputs.secrets).VK_TEAMS_BOT_TOKEN }} - to: ${{ fromJSON(inputs.secrets).VK_TEAMS_CHAT_ID }} + token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} + to: ${{ secrets.VK_TEAMS_CHAT_ID }} format: MarkdownV2 message: | ${{ github.repository }} \[${{inputs.name}}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ fromJson(env.ICONS)[inputs.result] }} From cb5d1652a3627eea0d4461297f2f246dfc7815da Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 11:43:09 +0300 Subject: [PATCH 07/34] test new build --- .github/workflows/build.yaml | 114 +++++++++++++++++++++++------------ 1 file changed, 76 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0296c6e..bfe065e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,51 +21,89 @@ jobs: CR_REPO: ${{ github.event.repository.name }} IMAGE_TAG: ${{ github.sha }} steps: - - name: Checkout - uses: actions/checkout@master - - name: Checkout LFS - if: ${{ inputs.lfs }} - run: | - UrlBase=$GITHUB_SERVER_URL; \ - UrlLfsBase=$UrlBase/${{ github.repository }}.git/info/lfs/objects; \ - Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \ - /usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \ - /usr/bin/git config --local http.${UrlLfsBase}/.extraheader '' + - name: notify + uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD + with: + result: 'started' + name: build tag ${{ inputs.tag }} + secrets: ${{ toJSON(secrets) }} + + - uses: actions/checkout@v4 + with: + lfs: ${{ inputs.lfs }} - git config --local lfs.transfer.maxretries 1 - git ls-remote - git lfs checkout - git lfs fetch - git lfs pull - #git lfs fetch origin refs/heads/${{ github.head_ref || github.ref_name }} - name: Use ssh key uses: webfactory/ssh-agent@v0.9.0 with: - ssh-private-key: | - ${{ secrets.LIB_SSH_KEY }} - ${{ secrets.LIB_NEW_SSH_KEY }} - - name: Build Docker image - run: | - if [ "$NO_CACHE" == "true" ]; then - docker build -t cr.yandex/$CR_REGISTRY/$CR_REPO:${IMAGE_TAG::7} --no-cache --ssh default . - else - docker build -t cr.yandex/$CR_REGISTRY/$CR_REPO:${IMAGE_TAG::7} --ssh default . - fi - env: - NO_CACHE: ${{ inputs.force_build || 'false' }} + ssh-private-key: | + ${{ secrets.LIB_SSH_KEY }} + ${{ secrets.LIB_NEW_SSH_KEY }} + - name: Yandex Cloud Login uses: yc-actions/yc-cr-login@v2 with: yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }} - - name: Tag image - env: - INPUT_TAG: ${{ inputs.tag }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + install: true + + - name: Shorten commit SHA + run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV + + - name: Normalize tag + id: normalize run: | - echo ${INPUT_TAG/\//-} ${IMAGE_TAG::7} $INPUT_TAG $IMAGE_TAG - docker tag cr.yandex/$CR_REGISTRY/$CR_REPO:${IMAGE_TAG::7} cr.yandex/$CR_REGISTRY/$CR_REPO:${INPUT_TAG/\//-} - - name: Push image - env: - INPUT_TAG: ${{ inputs.tag }} + SAFE_TAG=$(echo "${{ inputs.tag }}" | tr '/' '-') + echo "SAFE_TAG=$SAFE_TAG" >> $GITHUB_ENV + + - name: Restore Docker layer cache + uses: actions/cache/restore@v4 + with: + path: /cache/buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Build and push multi-arch image + id: build-step + uses: docker/build-push-action@v6 + with: + push: true + context: . + builder: ${{ steps.buildx.outputs.name }} + tags: | + cr.yandex/${{ env.CR_REGISTRY }}/${{ env.CR_REPO }}:${{ env.SHORT_SHA }} + cr.yandex/${{ env.CR_REGISTRY }}/${{ env.CR_REPO }}:${{ env.SAFE_TAG }} + platforms: linux/amd64,linux/arm64/v8 + ssh: default + no-cache: ${{ inputs.force_build }} + build-args: | + GIT_COMMIT=${{ github.sha }} + cache-from: | + type=local,src=/cache/buildx-cache + cache-to: | + type=local,dest=/cache/buildx-cache-new,mode=max + + - name: Move new cache + if: always() run: | - docker push cr.yandex/$CR_REGISTRY/$CR_REPO:${IMAGE_TAG::7} - docker push cr.yandex/$CR_REGISTRY/$CR_REPO:${INPUT_TAG/\//-} \ No newline at end of file + rm -rf /cache/buildx-cache + mv /cache/buildx-cache-new /cache/buildx-cache + + - name: Save Docker layer cache + if: always() + uses: actions/cache/save@v4 + with: + path: /cache/buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + + - name: post-notify + if: always() + uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD + with: + result: ${{ steps.build-step.outcome }} + name: build tag ${{ inputs.tag }} + secrets: ${{ toJSON(secrets) }} \ No newline at end of file From 4ae633017aa7b85b1b8deb6fee3fb89895a25077 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 13:02:22 +0300 Subject: [PATCH 08/34] =?UTF-8?q?te=D1=8B=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/actions/notify/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/actions/notify/action.yaml b/.gitea/actions/notify/action.yaml index 225b771..e91c9a5 100644 --- a/.gitea/actions/notify/action.yaml +++ b/.gitea/actions/notify/action.yaml @@ -23,8 +23,8 @@ runs: env: ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}' with: - token: ${{ fromJSON(inputs.secrets).VK_TEAMS_BOT_TOKEN }} - to: ${{ fromJSON(inputs.secrets).VK_TEAMS_CHAT_ID }} + token: ${{ fromJSON(inputs.secrets || '{}').VK_TEAMS_BOT_TOKEN }} + to: ${{ fromJSON(inputs.secrets || '{}').VK_TEAMS_CHAT_ID }} format: MarkdownV2 message: | ${{ github.repository }} \[${{inputs.name}}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ fromJson(env.ICONS)[inputs.result] }} From 62e29edb81223a7af68b4430322219e157d85b63 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 13:12:18 +0300 Subject: [PATCH 09/34] test --- .gitea/actions/notify/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/actions/notify/action.yaml b/.gitea/actions/notify/action.yaml index e91c9a5..10fff00 100644 --- a/.gitea/actions/notify/action.yaml +++ b/.gitea/actions/notify/action.yaml @@ -23,8 +23,8 @@ runs: env: ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}' with: - token: ${{ fromJSON(inputs.secrets || '{}').VK_TEAMS_BOT_TOKEN }} - to: ${{ fromJSON(inputs.secrets || '{}').VK_TEAMS_CHAT_ID }} + token: ${{ inputs.token }} + to: ${{ inputs.to }} format: MarkdownV2 message: | ${{ github.repository }} \[${{inputs.name}}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ fromJson(env.ICONS)[inputs.result] }} From 88b43a1bf3417e7d80fcd758ac3e299e27676f2a Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 13:18:44 +0300 Subject: [PATCH 10/34] test --- .gitea/actions/notify/action.yaml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.gitea/actions/notify/action.yaml b/.gitea/actions/notify/action.yaml index 10fff00..1ed69cc 100644 --- a/.gitea/actions/notify/action.yaml +++ b/.gitea/actions/notify/action.yaml @@ -19,13 +19,23 @@ inputs: runs: using: 'composite' steps: - - uses: dosymep/vk-teams-action@v1.0.0 - env: - ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}' - with: - token: ${{ inputs.token }} - to: ${{ inputs.to }} - format: MarkdownV2 - message: | - ${{ github.repository }} \[${{inputs.name}}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ fromJson(env.ICONS)[inputs.result] }} - + - name: Set icon + id: icon + shell: bash + run: | + case "${{ inputs.result }}" in + success) echo "ICON=✅" >> $GITHUB_ENV ;; + failure) echo "ICON=❌" >> $GITHUB_ENV ;; + canceled) echo "ICON=🤦" >> $GITHUB_ENV ;; + started) echo "ICON=⚠️" >> $GITHUB_ENV ;; + *) echo "ICON=ℹ️" >> $GITHUB_ENV ;; + esac + + - uses: dosymep/vk-teams-action@v1.0.0 + with: + token: ${{ inputs.token }} + to: ${{ inputs.to }} + format: MarkdownV2 + message: | + ${{ github.repository }} [${{ inputs.name }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}) + was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ env.ICON }} From 3d653b062731614fedd049ad9390b17524c2eb14 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 13:30:21 +0300 Subject: [PATCH 11/34] add runs on --- .gitea/actions/notify/action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/actions/notify/action.yaml b/.gitea/actions/notify/action.yaml index 1ed69cc..547ad50 100644 --- a/.gitea/actions/notify/action.yaml +++ b/.gitea/actions/notify/action.yaml @@ -18,6 +18,7 @@ inputs: runs: using: 'composite' + runs-on: gpu steps: - name: Set icon id: icon From 585585106aaa91da2cea7a28e4629a1cf9a8dba9 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 13:40:25 +0300 Subject: [PATCH 12/34] test --- .gitea/actions/notify/action.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitea/actions/notify/action.yaml b/.gitea/actions/notify/action.yaml index 547ad50..f5e6332 100644 --- a/.gitea/actions/notify/action.yaml +++ b/.gitea/actions/notify/action.yaml @@ -13,12 +13,17 @@ inputs: secrets: required: false type: string + token: + required: true + type: string + to: + required: true + type: string runs: using: 'composite' - runs-on: gpu steps: - name: Set icon id: icon From 648d04843937e4c7d89c4b8f4c941c01406c6fc1 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 13:44:30 +0300 Subject: [PATCH 13/34] test another notify --- .gitea/actions/{notify => vk-notify}/action.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .gitea/actions/{notify => vk-notify}/action.yaml (100%) diff --git a/.gitea/actions/notify/action.yaml b/.gitea/actions/vk-notify/action.yaml similarity index 100% rename from .gitea/actions/notify/action.yaml rename to .gitea/actions/vk-notify/action.yaml From aa879e978ca67522fed88ec177aba0f0f5ec0dc1 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 14:19:45 +0300 Subject: [PATCH 14/34] changes --- .gitea/actions/vk-notify/action.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.gitea/actions/vk-notify/action.yaml b/.gitea/actions/vk-notify/action.yaml index f5e6332..388d2d9 100644 --- a/.gitea/actions/vk-notify/action.yaml +++ b/.gitea/actions/vk-notify/action.yaml @@ -1,18 +1,15 @@ name: 'notify' -description: 'notify' +description: 'Send VK Teams notification' inputs: result: required: false - default: "failure" + default: "failure" type: string name: required: false type: string default: build - secrets: - required: false - type: string token: required: true type: string @@ -20,8 +17,6 @@ inputs: required: true type: string - - runs: using: 'composite' steps: @@ -37,11 +32,15 @@ runs: *) echo "ICON=ℹ️" >> $GITHUB_ENV ;; esac - - uses: dosymep/vk-teams-action@v1.0.0 + - name: Notify VK Teams + uses: dosymep/vk-teams-action@v1.0.0 with: token: ${{ inputs.token }} to: ${{ inputs.to }} format: MarkdownV2 message: | - ${{ github.repository }} [${{ inputs.name }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}) - was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ env.ICON }} + *${{ github.repository }}* \- \[${{ inputs.name }}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) \ + was *${{ inputs.result }}* by ${{ github.event.sender.login }} ${{ env.ICON }} + + - name: Wait a bit (ensure send completes) + run: sleep 5 From 409baf7d02f4d3fd558082ccda595ff69b2df9a8 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 14:25:18 +0300 Subject: [PATCH 15/34] test --- .github/workflows/notify.yaml | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/notify.yaml b/.github/workflows/notify.yaml index d8d2170..fcb84b5 100644 --- a/.github/workflows/notify.yaml +++ b/.github/workflows/notify.yaml @@ -1,25 +1,25 @@ -on: - workflow_call: - inputs: - result: - required: false - default: "failure" - type: string - name: - required: false - type: string - default: build -jobs: - notify: - runs-on: gpu - steps: - - uses: dosymep/vk-teams-action@v1.0.0 - env: - ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}' - with: - token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} - to: ${{ secrets.VK_TEAMS_CHAT_ID }} - format: MarkdownV2 - message: | - ${{ github.repository }} \[${{inputs.name}}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ fromJson(env.ICONS)[inputs.result] }} +# on: +# workflow_call: +# inputs: +# result: +# required: false +# default: "failure" +# type: string +# name: +# required: false +# type: string +# default: build +# jobs: +# notify: +# runs-on: gpu +# steps: +# - uses: dosymep/vk-teams-action@v1.0.0 +# env: +# ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}' +# with: +# token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} +# to: ${{ secrets.VK_TEAMS_CHAT_ID }} +# format: MarkdownV2 +# message: | +# ${{ github.repository }} \[${{inputs.name}}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ fromJson(env.ICONS)[inputs.result] }} From e76a3eb00ca08b111a3a6ac51916af3da1a97e49 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 14:43:00 +0300 Subject: [PATCH 16/34] test --- .github/workflows/build.yaml | 4 +-- .github/workflows/notify.yaml | 48 +++++++++++++++++------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bfe065e..19c3405 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -22,7 +22,7 @@ jobs: IMAGE_TAG: ${{ github.sha }} steps: - name: notify - uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD + uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main with: result: 'started' name: build tag ${{ inputs.tag }} @@ -102,7 +102,7 @@ jobs: - name: post-notify if: always() - uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD + uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main with: result: ${{ steps.build-step.outcome }} name: build tag ${{ inputs.tag }} diff --git a/.github/workflows/notify.yaml b/.github/workflows/notify.yaml index fcb84b5..d8d2170 100644 --- a/.github/workflows/notify.yaml +++ b/.github/workflows/notify.yaml @@ -1,25 +1,25 @@ -# on: -# workflow_call: -# inputs: -# result: -# required: false -# default: "failure" -# type: string -# name: -# required: false -# type: string -# default: build -# jobs: -# notify: -# runs-on: gpu -# steps: -# - uses: dosymep/vk-teams-action@v1.0.0 -# env: -# ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}' -# with: -# token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} -# to: ${{ secrets.VK_TEAMS_CHAT_ID }} -# format: MarkdownV2 -# message: | -# ${{ github.repository }} \[${{inputs.name}}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ fromJson(env.ICONS)[inputs.result] }} +on: + workflow_call: + inputs: + result: + required: false + default: "failure" + type: string + name: + required: false + type: string + default: build +jobs: + notify: + runs-on: gpu + steps: + - uses: dosymep/vk-teams-action@v1.0.0 + env: + ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}' + with: + token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} + to: ${{ secrets.VK_TEAMS_CHAT_ID }} + format: MarkdownV2 + message: | + ${{ github.repository }} \[${{inputs.name}}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) was ${{ inputs.result }} by ${{ github.event.sender.login }} ${{ fromJson(env.ICONS)[inputs.result] }} From b85e4f9798c878dbe76de65619d4ca9a57b35622 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 14:55:52 +0300 Subject: [PATCH 17/34] test --- .gitea/actions/vk-notify/action.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitea/actions/vk-notify/action.yaml b/.gitea/actions/vk-notify/action.yaml index 388d2d9..4f9a3c8 100644 --- a/.gitea/actions/vk-notify/action.yaml +++ b/.gitea/actions/vk-notify/action.yaml @@ -43,4 +43,10 @@ runs: was *${{ inputs.result }}* by ${{ github.event.sender.login }} ${{ env.ICON }} - name: Wait a bit (ensure send completes) - run: sleep 5 + shell: bash + run: | + echo "[DEBUG] Starting sleep to ensure message delivery..." + date + sleep 5 + echo "[DEBUG] Finished sleep, message should have been delivered." + date \ No newline at end of file From dbabf774c0349028beab9da57c887c8940b96ccc Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 15:03:45 +0300 Subject: [PATCH 18/34] always add --- .gitea/actions/vk-notify/action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/actions/vk-notify/action.yaml b/.gitea/actions/vk-notify/action.yaml index 4f9a3c8..a5863b3 100644 --- a/.gitea/actions/vk-notify/action.yaml +++ b/.gitea/actions/vk-notify/action.yaml @@ -43,6 +43,7 @@ runs: was *${{ inputs.result }}* by ${{ github.event.sender.login }} ${{ env.ICON }} - name: Wait a bit (ensure send completes) + if: always() shell: bash run: | echo "[DEBUG] Starting sleep to ensure message delivery..." From 3738ebbf5ae961ba75208fa9dda2e49713017161 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 15:08:38 +0300 Subject: [PATCH 19/34] add force wait --- .gitea/actions/vk-notify/action.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitea/actions/vk-notify/action.yaml b/.gitea/actions/vk-notify/action.yaml index a5863b3..bdcb59b 100644 --- a/.gitea/actions/vk-notify/action.yaml +++ b/.gitea/actions/vk-notify/action.yaml @@ -50,4 +50,17 @@ runs: date sleep 5 echo "[DEBUG] Finished sleep, message should have been delivered." - date \ No newline at end of file + date + + - name: Force wait for container cleanup + if: always() + shell: bash + run: | + echo "[DEBUG] Waiting for runner cleanup barrier..." + # пока Docker демон удаляет контейнер, удерживаем процесс активным + for i in {1..5}; do + docker ps -a | grep act || break + echo "[DEBUG] Runner still cleaning up... $i" + sleep 1 + done + echo "[DEBUG] Cleanup done." \ No newline at end of file From 6df55bdba676530886ca9caebeffaf222df99ff6 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 15:12:39 +0300 Subject: [PATCH 20/34] add new secret --- .gitea/actions/vk-notify/action.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.gitea/actions/vk-notify/action.yaml b/.gitea/actions/vk-notify/action.yaml index bdcb59b..8630b0f 100644 --- a/.gitea/actions/vk-notify/action.yaml +++ b/.gitea/actions/vk-notify/action.yaml @@ -10,12 +10,6 @@ inputs: required: false type: string default: build - token: - required: true - type: string - to: - required: true - type: string runs: using: 'composite' @@ -35,8 +29,8 @@ runs: - name: Notify VK Teams uses: dosymep/vk-teams-action@v1.0.0 with: - token: ${{ inputs.token }} - to: ${{ inputs.to }} + token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} + to: ${{ secrets.VK_TEAMS_CHAT_ID }} format: MarkdownV2 message: | *${{ github.repository }}* \- \[${{ inputs.name }}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) \ From 3ad43d0a1deb4f36162ffb0568eb947c6d7a0f43 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 15:21:11 +0300 Subject: [PATCH 21/34] test new build --- .github/workflows/build.yaml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 19c3405..dcd0693 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,7 +11,11 @@ on: force_build: type: boolean default: false - + secrets: + VK_TEAMS_BOT_TOKEN: + required: true + VK_TEAMS_CHAT_ID: + required: true jobs: build: @@ -20,13 +24,15 @@ jobs: CR_REGISTRY: crp8vh46gd976oq8ipla CR_REPO: ${{ github.event.repository.name }} IMAGE_TAG: ${{ github.sha }} + steps: - - name: notify + - name: Notify (started) uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main with: - result: 'started' + result: started name: build tag ${{ inputs.tag }} - secrets: ${{ toJSON(secrets) }} + token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} + to: ${{ secrets.VK_TEAMS_CHAT_ID }} - uses: actions/checkout@v4 with: @@ -100,10 +106,11 @@ jobs: path: /cache/buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} - - name: post-notify + - name: Notify (result) if: always() uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main with: result: ${{ steps.build-step.outcome }} name: build tag ${{ inputs.tag }} - secrets: ${{ toJSON(secrets) }} \ No newline at end of file + token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} + to: ${{ secrets.VK_TEAMS_CHAT_ID }} From 59d50a60ed5b4f3ce645e939806ef7a09ebe2146 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 15:25:44 +0300 Subject: [PATCH 22/34] update --- .gitea/actions/vk-notify/action.yaml | 10 ++++++++++ .github/workflows/build.yaml | 12 +++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.gitea/actions/vk-notify/action.yaml b/.gitea/actions/vk-notify/action.yaml index 8630b0f..b3aea20 100644 --- a/.gitea/actions/vk-notify/action.yaml +++ b/.gitea/actions/vk-notify/action.yaml @@ -14,6 +14,16 @@ inputs: runs: using: 'composite' steps: + - name: Resolve token/from env if missing + shell: bash + run: | + if [ -z "${{ inputs.token }}" ] && [ -n "${VK_TEAMS_BOT_TOKEN}" ]; then + echo "token=${VK_TEAMS_BOT_TOKEN}" >> $GITHUB_ENV + fi + if [ -z "${{ inputs.to }}" ] && [ -n "${VK_TEAMS_CHAT_ID}" ]; then + echo "to=${VK_TEAMS_CHAT_ID}" >> $GITHUB_ENV + fi + - name: Set icon id: icon shell: bash diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index dcd0693..196df76 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,11 +28,12 @@ jobs: steps: - name: Notify (started) uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main + env: + VK_TEAMS_BOT_TOKEN: ${{ secrets.VK_TEAMS_BOT_TOKEN }} + VK_TEAMS_CHAT_ID: ${{ secrets.VK_TEAMS_CHAT_ID }} with: result: started name: build tag ${{ inputs.tag }} - token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} - to: ${{ secrets.VK_TEAMS_CHAT_ID }} - uses: actions/checkout@v4 with: @@ -109,8 +110,9 @@ jobs: - name: Notify (result) if: always() uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main + env: + VK_TEAMS_BOT_TOKEN: ${{ secrets.VK_TEAMS_BOT_TOKEN }} + VK_TEAMS_CHAT_ID: ${{ secrets.VK_TEAMS_CHAT_ID }} with: - result: ${{ steps.build-step.outcome }} + result: started name: build tag ${{ inputs.tag }} - token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} - to: ${{ secrets.VK_TEAMS_CHAT_ID }} From b09c683175a04c9ac4da89048f9cccc224195f5f Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 15:29:02 +0300 Subject: [PATCH 23/34] change --- .gitea/actions/vk-notify/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/actions/vk-notify/action.yaml b/.gitea/actions/vk-notify/action.yaml index b3aea20..8cd7372 100644 --- a/.gitea/actions/vk-notify/action.yaml +++ b/.gitea/actions/vk-notify/action.yaml @@ -23,7 +23,7 @@ runs: if [ -z "${{ inputs.to }}" ] && [ -n "${VK_TEAMS_CHAT_ID}" ]; then echo "to=${VK_TEAMS_CHAT_ID}" >> $GITHUB_ENV fi - + - name: Set icon id: icon shell: bash @@ -39,8 +39,8 @@ runs: - name: Notify VK Teams uses: dosymep/vk-teams-action@v1.0.0 with: - token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} - to: ${{ secrets.VK_TEAMS_CHAT_ID }} + token: ${{ env.token }} + to: ${{ env.to }} format: MarkdownV2 message: | *${{ github.repository }}* \- \[${{ inputs.name }}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) \ From dc07d5d072c1786c3047def9f4d7b0072a0dfe8d Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 15:54:09 +0300 Subject: [PATCH 24/34] test contune on error --- .gitea/actions/vk-notify/action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/actions/vk-notify/action.yaml b/.gitea/actions/vk-notify/action.yaml index 8cd7372..11a6a91 100644 --- a/.gitea/actions/vk-notify/action.yaml +++ b/.gitea/actions/vk-notify/action.yaml @@ -38,6 +38,7 @@ runs: - name: Notify VK Teams uses: dosymep/vk-teams-action@v1.0.0 + continue-on-error: true with: token: ${{ env.token }} to: ${{ env.to }} From a11bec63b9fbfc5301ab703b93256e9ddcab4d49 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 16:08:41 +0300 Subject: [PATCH 25/34] native variant --- .gitea/actions/vk-notify/action.yaml | 55 +++++++++++++--------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/.gitea/actions/vk-notify/action.yaml b/.gitea/actions/vk-notify/action.yaml index 11a6a91..a5ad27c 100644 --- a/.gitea/actions/vk-notify/action.yaml +++ b/.gitea/actions/vk-notify/action.yaml @@ -36,36 +36,31 @@ runs: *) echo "ICON=ℹ️" >> $GITHUB_ENV ;; esac - - name: Notify VK Teams - uses: dosymep/vk-teams-action@v1.0.0 + - name: Notify VK Teams (native) + if: always() + shell: bash continue-on-error: true - with: - token: ${{ env.token }} - to: ${{ env.to }} - format: MarkdownV2 - message: | - *${{ github.repository }}* \- \[${{ inputs.name }}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) \ - was *${{ inputs.result }}* by ${{ github.event.sender.login }} ${{ env.ICON }} - - - name: Wait a bit (ensure send completes) - if: always() - shell: bash run: | - echo "[DEBUG] Starting sleep to ensure message delivery..." - date - sleep 5 - echo "[DEBUG] Finished sleep, message should have been delivered." - date + echo "[DEBUG] Sending VK Teams notification..." + JSON_PAYLOAD=$(jq -n \ + --arg token "${{ env.token }}" \ + --arg to "${{ env.to }}" \ + --arg fmt "MarkdownV2" \ + --arg msg "*${{ github.repository }}* - [${{ inputs.name }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}) was *${{ inputs.result }}* by ${{ github.event.sender.login }} ${{ env.ICON }}" \ + '{token: $token, chatId: $to, parseMode: $fmt, text: $msg}') - - name: Force wait for container cleanup - if: always() - shell: bash - run: | - echo "[DEBUG] Waiting for runner cleanup barrier..." - # пока Docker демон удаляет контейнер, удерживаем процесс активным - for i in {1..5}; do - docker ps -a | grep act || break - echo "[DEBUG] Runner still cleaning up... $i" - sleep 1 - done - echo "[DEBUG] Cleanup done." \ No newline at end of file + # Отправка запроса + curl -s -X POST "https://myteam.mail.ru/bot/v1/messages/sendText" \ + -H "Content-Type: application/json" \ + -d "$JSON_PAYLOAD" + + CODE=$? + if [ $CODE -ne 0 ]; then + echo "[WARN] VK Teams notification failed with exit code $CODE" + else + echo "[INFO] VK Teams notification sent successfully" + fi + + # Делаем паузу, чтобы убедиться, что сообщение дошло + echo "[DEBUG] Sleeping 5s to ensure delivery..." + sleep 5 \ No newline at end of file From 9aeb793f011248bb5c64ea82adb929446af811d7 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 16:45:39 +0300 Subject: [PATCH 26/34] test --- .gitea/actions/vk-notify/action.yaml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.gitea/actions/vk-notify/action.yaml b/.gitea/actions/vk-notify/action.yaml index a5ad27c..5f033de 100644 --- a/.gitea/actions/vk-notify/action.yaml +++ b/.gitea/actions/vk-notify/action.yaml @@ -42,17 +42,11 @@ runs: continue-on-error: true run: | echo "[DEBUG] Sending VK Teams notification..." - JSON_PAYLOAD=$(jq -n \ - --arg token "${{ env.token }}" \ - --arg to "${{ env.to }}" \ - --arg fmt "MarkdownV2" \ - --arg msg "*${{ github.repository }}* - [${{ inputs.name }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}) was *${{ inputs.result }}* by ${{ github.event.sender.login }} ${{ env.ICON }}" \ - '{token: $token, chatId: $to, parseMode: $fmt, text: $msg}') - - # Отправка запроса - curl -s -X POST "https://myteam.mail.ru/bot/v1/messages/sendText" \ - -H "Content-Type: application/json" \ - -d "$JSON_PAYLOAD" + curl -G "https://myteam.mail.ru/bot/v1/messages/sendText" \ + --data-urlencode "token=${{ env.token }}" \ + --data-urlencode "chatId=${{ env.to }}" \ + --data-urlencode "parseMode=MarkdownV2" \ + --data-urlencode "text=*${{ github.repository }}* - [${{ inputs.name }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}) was *${{ inputs.result }}* by ${{ github.event.sender.login }} ${{ env.ICON }}" CODE=$? if [ $CODE -ne 0 ]; then From f8164829832a5feb4be6f7f4e78393d44f1afe58 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 16:57:38 +0300 Subject: [PATCH 27/34] Lil fix --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 196df76..b79eb07 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -114,5 +114,5 @@ jobs: VK_TEAMS_BOT_TOKEN: ${{ secrets.VK_TEAMS_BOT_TOKEN }} VK_TEAMS_CHAT_ID: ${{ secrets.VK_TEAMS_CHAT_ID }} with: - result: started + result: ${{ steps.build-step.outcome }} name: build tag ${{ inputs.tag }} From 23c6930c117147f25cea07c7b83d9f8d00669b02 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Oct 2025 18:23:35 +0300 Subject: [PATCH 28/34] fix lil --- .github/workflows/build.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b79eb07..d481614 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -94,11 +94,16 @@ jobs: cache-to: | type=local,dest=/cache/buildx-cache-new,mode=max - - name: Move new cache + - name: Move new cache if it exists if: always() run: | - rm -rf /cache/buildx-cache - mv /cache/buildx-cache-new /cache/buildx-cache + if [ -d /cache/buildx-cache-new ]; then + echo "Found new buildx cache, replacing old one..." + rm -rf /cache/buildx-cache + mv /cache/buildx-cache-new /cache/buildx-cache + else + echo "No new buildx cache found, keeping old one." + fi - name: Save Docker layer cache if: always() From 57998e19a9a74c4a0f42d522d787f6f45f875226 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 16 Oct 2025 10:48:38 +0300 Subject: [PATCH 29/34] vk-notify --- .github/workflows/deployk8s.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployk8s.yaml b/.github/workflows/deployk8s.yaml index b7e621d..c58a67b 100644 --- a/.github/workflows/deployk8s.yaml +++ b/.github/workflows/deployk8s.yaml @@ -32,7 +32,7 @@ jobs: TAG: ${{ inputs.tag }} steps: - name: notify - uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD + uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main with: result: 'started' secrets: ${{ toJSON(secrets) }} @@ -47,7 +47,7 @@ jobs: migrate: ${{ inputs.migrate }} - name: post-notify if: always() - uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD + uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main with: result: ${{ steps.k8s_deploy.outcome }} name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} From 86934c05e8d13e76300509228f8eb43efd558a64 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 16 Oct 2025 11:04:24 +0300 Subject: [PATCH 30/34] fix notify in deploy --- .github/workflows/deployk8s.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deployk8s.yaml b/.github/workflows/deployk8s.yaml index c58a67b..2bd7828 100644 --- a/.github/workflows/deployk8s.yaml +++ b/.github/workflows/deployk8s.yaml @@ -33,9 +33,11 @@ jobs: steps: - name: notify uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main + env: + VK_TEAMS_BOT_TOKEN: ${{ secrets.VK_TEAMS_BOT_TOKEN }} + VK_TEAMS_CHAT_ID: ${{ secrets.VK_TEAMS_CHAT_ID }} with: result: 'started' - secrets: ${{ toJSON(secrets) }} name: deploy ${{ inputs.environment }} tag ${{ inputs.tag }} - name: deploy id: k8s_deploy @@ -48,7 +50,9 @@ jobs: - name: post-notify if: always() uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main + env: + VK_TEAMS_BOT_TOKEN: ${{ secrets.VK_TEAMS_BOT_TOKEN }} + VK_TEAMS_CHAT_ID: ${{ secrets.VK_TEAMS_CHAT_ID }} with: result: ${{ steps.k8s_deploy.outcome }} - name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} - secrets: ${{ toJSON(secrets) }} \ No newline at end of file + name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} From 31eccd5c091a7e4c9caf6f316bc729a5a4fa6246 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 16 Oct 2025 14:25:18 +0300 Subject: [PATCH 31/34] change cash --- .github/workflows/build.yaml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d481614..6a4b2ea 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -69,9 +69,10 @@ jobs: - name: Restore Docker layer cache uses: actions/cache/restore@v4 with: - path: /cache/buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + path: /cache/${{ github.repository }}/buildx-cache + key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles('Dockerfile', '**/requirements.txt', '**/*lock*', '**/package-lock.json', '**/poetry.lock') }} restore-keys: | + ${{ runner.os }}-${{ github.repository }}-buildx- ${{ runner.os }}-buildx- - name: Build and push multi-arch image @@ -90,17 +91,18 @@ jobs: build-args: | GIT_COMMIT=${{ github.sha }} cache-from: | - type=local,src=/cache/buildx-cache + type=local,src=/cache/${{ github.repository }}/buildx-cache cache-to: | - type=local,dest=/cache/buildx-cache-new,mode=max + type=local,dest=/cache/${{ github.repository }}/buildx-cache-new,mode=max - name: Move new cache if it exists if: always() run: | - if [ -d /cache/buildx-cache-new ]; then + mkdir -p /cache/${{ github.repository }} + if [ -d /cache/${{ github.repository }}/buildx-cache-new ]; then echo "Found new buildx cache, replacing old one..." - rm -rf /cache/buildx-cache - mv /cache/buildx-cache-new /cache/buildx-cache + rm -rf /cache/${{ github.repository }}/buildx-cache + mv /cache/${{ github.repository }}/buildx-cache-new /cache/${{ github.repository }}/buildx-cache else echo "No new buildx cache found, keeping old one." fi @@ -109,8 +111,8 @@ jobs: if: always() uses: actions/cache/save@v4 with: - path: /cache/buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + path: /cache/${{ github.repository }}/buildx-cache + key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles('Dockerfile', '**/requirements.txt', '**/*lock*', '**/package-lock.json', '**/poetry.lock') }} - name: Notify (result) if: always() From a6877dda7e5f4eb4b6ec6c09c2f16d4fd65ba391 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 17 Oct 2025 15:32:54 +0300 Subject: [PATCH 32/34] test arch --- .github/workflows/build.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6a4b2ea..dcc16ae 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,6 +11,9 @@ on: force_build: type: boolean default: false + arch: + type: string + default: "linux/amd64,linux/arm64/v8" secrets: VK_TEAMS_BOT_TOKEN: required: true @@ -85,7 +88,7 @@ jobs: tags: | cr.yandex/${{ env.CR_REGISTRY }}/${{ env.CR_REPO }}:${{ env.SHORT_SHA }} cr.yandex/${{ env.CR_REGISTRY }}/${{ env.CR_REPO }}:${{ env.SAFE_TAG }} - platforms: linux/amd64,linux/arm64/v8 + platforms: ${{ inputs.arch }} ssh: default no-cache: ${{ inputs.force_build }} build-args: | From 2e4141834e1d5dbccdd1117611362831afb3e14e Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 21 Oct 2025 18:14:09 +0300 Subject: [PATCH 33/34] change absolute way --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index dcc16ae..a36bfc6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -73,7 +73,7 @@ jobs: uses: actions/cache/restore@v4 with: path: /cache/${{ github.repository }}/buildx-cache - key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles('Dockerfile', '**/requirements.txt', '**/*lock*', '**/package-lock.json', '**/poetry.lock') }} + key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles(format('{0}/Dockerfile', github.workspace), format('{0}/**/requirements.txt', github.workspace), format('{0}/**/*lock*', github.workspace), format('{0}/**/package-lock.json', github.workspace), format('{0}/**/poetry.lock', github.workspace)) }} restore-keys: | ${{ runner.os }}-${{ github.repository }}-buildx- ${{ runner.os }}-buildx- @@ -115,7 +115,7 @@ jobs: uses: actions/cache/save@v4 with: path: /cache/${{ github.repository }}/buildx-cache - key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles('Dockerfile', '**/requirements.txt', '**/*lock*', '**/package-lock.json', '**/poetry.lock') }} + key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles(format('{0}/Dockerfile', github.workspace), format('{0}/**/requirements.txt', github.workspace), format('{0}/**/*lock*', github.workspace), format('{0}/**/package-lock.json', github.workspace), format('{0}/**/poetry.lock', github.workspace)) }} - name: Notify (result) if: always() From 8864f9585e500c52c1f06280a82eb5bf5d7971f9 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 11 Nov 2025 14:06:46 +0300 Subject: [PATCH 34/34] new deploy condition --- .github/workflows/deployk8s.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployk8s.yaml b/.github/workflows/deployk8s.yaml index 2bd7828..12a9f89 100644 --- a/.github/workflows/deployk8s.yaml +++ b/.github/workflows/deployk8s.yaml @@ -24,7 +24,7 @@ on: jobs: deploy: - if: contains(format(',{0},', vars.ADMIN_USERS), format(',{0},', github.actor)) || inputs.environment=='stage' + if: ${{ contains(format(',{0},', vars.ADMIN_USERS), format(',{0},', github.actor)) || startsWith(inputs.environment, 'stage') }} runs-on: ubuntu-latest env: CR_REGISTRY: crp8vh46gd976oq8ipla