73 Commits

Author SHA1 Message Date
f0f354a8d4 Merge branch 'main' into new_notify 2025-11-11 11:09:56 +00:00
8864f9585e new deploy condition 2025-11-11 14:06:46 +03:00
b7fb2ed335 Merge pull request 'new_notify' (#48) from new_notify into main
Reviewed-on: #48
2025-10-21 15:14:52 +00:00
760b6a8257 Merge branch 'main' into new_notify 2025-10-21 15:14:44 +00:00
d7bae2b72f Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-21 18:14:12 +03:00
2e4141834e change absolute way 2025-10-21 18:14:09 +03:00
4576ab5751 Merge pull request 'test arch' (#47) from new_notify into main
Reviewed-on: #47
2025-10-17 12:33:50 +00:00
5114bcf9fe Merge branch 'main' into new_notify 2025-10-17 12:33:45 +00:00
a6877dda7e test arch 2025-10-17 15:32:54 +03:00
6d04254346 Merge pull request 'change cash' (#46) from new_notify into main
Reviewed-on: #46
2025-10-16 11:25:52 +00:00
50c5bc458a Merge branch 'main' into new_notify 2025-10-16 11:25:40 +00:00
31eccd5c09 change cash 2025-10-16 14:25:18 +03:00
a0f83b72d1 Merge pull request 'new_notify' (#45) from new_notify into main
Reviewed-on: #45
2025-10-16 08:04:52 +00:00
fc1da26055 Merge branch 'main' into new_notify 2025-10-16 08:04:46 +00:00
8689d0d108 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-16 11:04:27 +03:00
86934c05e8 fix notify in deploy 2025-10-16 11:04:24 +03:00
52f6139528 Merge pull request 'new_notify' (#44) from new_notify into main
Reviewed-on: #44
2025-10-16 07:49:03 +00:00
de7b8c7d7f Merge branch 'main' into new_notify 2025-10-16 07:48:53 +00:00
1fdc459c07 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-16 10:48:40 +03:00
57998e19a9 vk-notify 2025-10-16 10:48:38 +03:00
9c829b3543 Merge pull request 'fix lil' (#43) from new_notify into main
Reviewed-on: #43
2025-10-15 15:24:18 +00:00
6c1d7a9176 Merge branch 'main' into new_notify 2025-10-15 15:24:10 +00:00
23c6930c11 fix lil 2025-10-15 18:23:35 +03:00
f1e3fc9bae Merge pull request 'Lil fix' (#42) from new_notify into main
Reviewed-on: #42
2025-10-15 13:59:00 +00:00
bac7e0abb3 Merge branch 'main' into new_notify 2025-10-15 13:58:55 +00:00
f816482983 Lil fix 2025-10-15 16:57:38 +03:00
2e1a74b96c Merge pull request 'new_notify' (#41) from new_notify into main
Reviewed-on: #41
2025-10-15 13:46:51 +00:00
2daf21ea55 Merge branch 'main' into new_notify 2025-10-15 13:46:45 +00:00
2d6aa07554 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 16:45:43 +03:00
9aeb793f01 test 2025-10-15 16:45:39 +03:00
30764b992f Merge pull request 'new_notify' (#40) from new_notify into main
Reviewed-on: #40
2025-10-15 13:09:46 +00:00
e88e4ea301 Merge branch 'main' into new_notify 2025-10-15 13:09:39 +00:00
1f046574b5 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 16:08:44 +03:00
a11bec63b9 native variant 2025-10-15 16:08:41 +03:00
7356e38489 Merge pull request 'new_notify' (#39) from new_notify into main
Reviewed-on: #39
2025-10-15 12:54:45 +00:00
68a19a3df7 Merge branch 'main' into new_notify 2025-10-15 12:54:39 +00:00
67647fb4dd Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 15:54:10 +03:00
dc07d5d072 test contune on error 2025-10-15 15:54:09 +03:00
3a09c44958 Merge pull request 'new_notify' (#38) from new_notify into main
Reviewed-on: #38
2025-10-15 12:29:34 +00:00
abde7da623 Merge branch 'main' into new_notify 2025-10-15 12:29:29 +00:00
5f90f6f544 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 15:29:04 +03:00
b09c683175 change 2025-10-15 15:29:02 +03:00
321d04ed3d Merge pull request 'new_notify' (#37) from new_notify into main
Reviewed-on: #37
2025-10-15 12:26:17 +00:00
630d1767b1 Merge branch 'main' into new_notify 2025-10-15 12:26:07 +00:00
b827427591 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 15:25:47 +03:00
59d50a60ed update 2025-10-15 15:25:44 +03:00
5bf1f99e2e Merge pull request 'new_notify' (#36) from new_notify into main
Reviewed-on: #36
2025-10-15 12:21:41 +00:00
1aba1d5df0 Merge branch 'main' into new_notify 2025-10-15 12:21:33 +00:00
56927923ad Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 15:21:14 +03:00
3ad43d0a1d test new build 2025-10-15 15:21:11 +03:00
433faca4b8 Merge pull request 'new_notify' (#35) from new_notify into main
Reviewed-on: #35
2025-10-15 12:13:30 +00:00
67b06db4ed Merge branch 'main' into new_notify 2025-10-15 12:13:16 +00:00
e1d609741a Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 15:12:41 +03:00
6df55bdba6 add new secret 2025-10-15 15:12:39 +03:00
ccdccf017d Merge pull request 'new_notify' (#34) from new_notify into main
Reviewed-on: #34
2025-10-15 12:09:20 +00:00
6f45d23dcf Merge branch 'main' into new_notify 2025-10-15 12:09:16 +00:00
c5f51b48ae Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 15:08:41 +03:00
3738ebbf5a add force wait 2025-10-15 15:08:38 +03:00
15a1443b9a Merge pull request 'new_notify' (#33) from new_notify into main
Reviewed-on: #33
2025-10-15 12:04:33 +00:00
3d8578c9a2 Merge branch 'main' into new_notify 2025-10-15 12:04:29 +00:00
fa2c1e58e9 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 15:03:47 +03:00
dbabf774c0 always add 2025-10-15 15:03:45 +03:00
f50569e257 Merge pull request 'new_notify' (#32) from new_notify into main
Reviewed-on: #32
2025-10-15 11:56:27 +00:00
acbcb78390 Merge branch 'main' into new_notify 2025-10-15 11:56:20 +00:00
4e2494a6a1 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 14:55:54 +03:00
b85e4f9798 test 2025-10-15 14:55:52 +03:00
479433991c Merge pull request 'new_notify' (#31) from new_notify into main
Reviewed-on: #31
2025-10-15 11:43:25 +00:00
5a2fa01284 Merge branch 'main' into new_notify 2025-10-15 11:43:18 +00:00
42891a309a Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 14:43:03 +03:00
e76a3eb00c test 2025-10-15 14:43:00 +03:00
aacefe062d Merge pull request 'new_notify' (#30) from new_notify into main
Reviewed-on: #30
2025-10-15 11:25:38 +00:00
40b367814b Merge branch 'main' into new_notify 2025-10-15 11:25:30 +00:00
7c01158b57 Merge pull request 'new_notify' (#29) from new_notify into main
Reviewed-on: #29
2025-10-15 11:20:21 +00:00
4 changed files with 102 additions and 65 deletions

View File

@@ -10,16 +10,20 @@ inputs:
required: false required: false
type: string type: string
default: build default: build
token:
required: true
type: string
to:
required: true
type: string
runs: runs:
using: 'composite' using: 'composite'
steps: 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 - name: Set icon
id: icon id: icon
shell: bash shell: bash
@@ -32,15 +36,25 @@ runs:
*) echo "ICON=" >> $GITHUB_ENV ;; *) echo "ICON=" >> $GITHUB_ENV ;;
esac esac
- name: Notify VK Teams - name: Notify VK Teams (native)
uses: dosymep/vk-teams-action@v1.0.0 if: always()
with: shell: bash
token: ${{ inputs.token }} continue-on-error: true
to: ${{ inputs.to }} run: |
format: MarkdownV2 echo "[DEBUG] Sending VK Teams notification..."
message: | curl -G "https://myteam.mail.ru/bot/v1/messages/sendText" \
*${{ github.repository }}* \- \[${{ inputs.name }}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) \ --data-urlencode "token=${{ env.token }}" \
was *${{ inputs.result }}* by ${{ github.event.sender.login }} ${{ env.ICON }} --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 }}"
- name: Wait a bit (ensure send completes) CODE=$?
run: sleep 5 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

View File

@@ -11,7 +11,14 @@ on:
force_build: force_build:
type: boolean type: boolean
default: false default: false
arch:
type: string
default: "linux/amd64,linux/arm64/v8"
secrets:
VK_TEAMS_BOT_TOKEN:
required: true
VK_TEAMS_CHAT_ID:
required: true
jobs: jobs:
build: build:
@@ -20,13 +27,16 @@ jobs:
CR_REGISTRY: crp8vh46gd976oq8ipla CR_REGISTRY: crp8vh46gd976oq8ipla
CR_REPO: ${{ github.event.repository.name }} CR_REPO: ${{ github.event.repository.name }}
IMAGE_TAG: ${{ github.sha }} IMAGE_TAG: ${{ github.sha }}
steps: steps:
- name: notify - name: Notify (started)
uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/notify@HEAD 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: with:
result: 'started' result: started
name: build tag ${{ inputs.tag }} name: build tag ${{ inputs.tag }}
secrets: ${{ toJSON(secrets) }}
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -62,9 +72,10 @@ jobs:
- name: Restore Docker layer cache - name: Restore Docker layer cache
uses: actions/cache/restore@v4 uses: actions/cache/restore@v4
with: with:
path: /cache/buildx-cache path: /cache/${{ github.repository }}/buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }} 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: | restore-keys: |
${{ runner.os }}-${{ github.repository }}-buildx-
${{ runner.os }}-buildx- ${{ runner.os }}-buildx-
- name: Build and push multi-arch image - name: Build and push multi-arch image
@@ -77,33 +88,41 @@ jobs:
tags: | tags: |
cr.yandex/${{ env.CR_REGISTRY }}/${{ env.CR_REPO }}:${{ env.SHORT_SHA }} cr.yandex/${{ env.CR_REGISTRY }}/${{ env.CR_REPO }}:${{ env.SHORT_SHA }}
cr.yandex/${{ env.CR_REGISTRY }}/${{ env.CR_REPO }}:${{ env.SAFE_TAG }} cr.yandex/${{ env.CR_REGISTRY }}/${{ env.CR_REPO }}:${{ env.SAFE_TAG }}
platforms: linux/amd64,linux/arm64/v8 platforms: ${{ inputs.arch }}
ssh: default ssh: default
no-cache: ${{ inputs.force_build }} no-cache: ${{ inputs.force_build }}
build-args: | build-args: |
GIT_COMMIT=${{ github.sha }} GIT_COMMIT=${{ github.sha }}
cache-from: | cache-from: |
type=local,src=/cache/buildx-cache type=local,src=/cache/${{ github.repository }}/buildx-cache
cache-to: | 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 - name: Move new cache if it exists
if: always() if: always()
run: | run: |
rm -rf /cache/buildx-cache mkdir -p /cache/${{ github.repository }}
mv /cache/buildx-cache-new /cache/buildx-cache if [ -d /cache/${{ github.repository }}/buildx-cache-new ]; then
echo "Found new buildx cache, replacing old one..."
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
- name: Save Docker layer cache - name: Save Docker layer cache
if: always() if: always()
uses: actions/cache/save@v4 uses: actions/cache/save@v4
with: with:
path: /cache/buildx-cache path: /cache/${{ github.repository }}/buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }} 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: post-notify - name: Notify (result)
if: always() 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
env:
VK_TEAMS_BOT_TOKEN: ${{ secrets.VK_TEAMS_BOT_TOKEN }}
VK_TEAMS_CHAT_ID: ${{ secrets.VK_TEAMS_CHAT_ID }}
with: with:
result: ${{ steps.build-step.outcome }} result: ${{ steps.build-step.outcome }}
name: build tag ${{ inputs.tag }} name: build tag ${{ inputs.tag }}
secrets: ${{ toJSON(secrets) }}

View File

@@ -24,7 +24,7 @@ on:
jobs: jobs:
deploy: 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 runs-on: ubuntu-latest
env: env:
CR_REGISTRY: crp8vh46gd976oq8ipla CR_REGISTRY: crp8vh46gd976oq8ipla
@@ -32,10 +32,12 @@ jobs:
TAG: ${{ inputs.tag }} TAG: ${{ inputs.tag }}
steps: steps:
- name: notify - 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
env:
VK_TEAMS_BOT_TOKEN: ${{ secrets.VK_TEAMS_BOT_TOKEN }}
VK_TEAMS_CHAT_ID: ${{ secrets.VK_TEAMS_CHAT_ID }}
with: with:
result: 'started' result: 'started'
secrets: ${{ toJSON(secrets) }}
name: deploy ${{ inputs.environment }} tag ${{ inputs.tag }} name: deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
- name: deploy - name: deploy
id: k8s_deploy id: k8s_deploy
@@ -47,8 +49,10 @@ jobs:
migrate: ${{ inputs.migrate }} migrate: ${{ inputs.migrate }}
- name: post-notify - name: post-notify
if: always() 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
env:
VK_TEAMS_BOT_TOKEN: ${{ secrets.VK_TEAMS_BOT_TOKEN }}
VK_TEAMS_CHAT_ID: ${{ secrets.VK_TEAMS_CHAT_ID }}
with: with:
result: ${{ steps.k8s_deploy.outcome }} result: ${{ steps.k8s_deploy.outcome }}
name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
secrets: ${{ toJSON(secrets) }}

View File

@@ -1,25 +1,25 @@
# on: on:
# workflow_call: workflow_call:
# inputs: inputs:
# result: result:
# required: false required: false
# default: "failure" default: "failure"
# type: string type: string
# name: name:
# required: false required: false
# type: string type: string
# default: build default: build
# jobs: jobs:
# notify: notify:
# runs-on: gpu runs-on: gpu
# steps: steps:
# - uses: dosymep/vk-teams-action@v1.0.0 - uses: dosymep/vk-teams-action@v1.0.0
# env: env:
# ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}' ICONS: '{"success":"✅","failure":"❌","canceled":"🤦","started":"⚠️"}'
# with: with:
# token: ${{ secrets.VK_TEAMS_BOT_TOKEN }} token: ${{ secrets.VK_TEAMS_BOT_TOKEN }}
# to: ${{ secrets.VK_TEAMS_CHAT_ID }} to: ${{ secrets.VK_TEAMS_CHAT_ID }}
# format: MarkdownV2 format: MarkdownV2
# message: | 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] }} ${{ 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] }}