180 Commits
final3 ... main

Author SHA1 Message Date
1540fce056 Merge pull request 'fix: cache only when build succesfull' (#59) from fix-build-cache into main
Reviewed-on: #59
Reviewed-by: nikitos <andriyanov@me.com>
2025-12-30 14:30:27 +00:00
0dcd1b5a97 fix: cache only when build succesfull 2025-12-30 07:24:30 +00:00
3c3cf1e01e Update .github/workflows/deployk8s.yaml 2025-12-19 13:08:06 +00:00
32235cb102 Update .github/workflows/deployk8s.yaml 2025-12-19 13:03:50 +00:00
a750a6b0cd Update .github/workflows/deployk8s.yaml 2025-12-19 12:54:49 +00:00
04914682ab Update .gitea/actions/k8s/action.yaml 2025-12-19 12:48:48 +00:00
26d0ef1b21 Update .github/workflows/deployk8s.yaml 2025-12-19 12:44:06 +00:00
b91d822d12 Update .github/workflows/deployk8s.yaml 2025-12-19 12:30:34 +00:00
6b3551e14e Update .gitea/actions/k8s/action.yaml 2025-12-19 12:29:30 +00:00
455f632cab Update .github/workflows/deployk8s.yaml 2025-12-19 12:19:14 +00:00
09181ac7b1 Update .gitea/actions/k8s/action.yaml 2025-12-19 12:15:16 +00:00
856783726d Update .gitea/actions/k8s/action.yaml 2025-12-19 12:15:03 +00:00
378b930ccc Update .gitea/actions/k8s/action.yaml 2025-12-19 12:14:45 +00:00
eeb15eb7dc Update .github/workflows/deployk8s.yaml 2025-12-19 12:10:24 +00:00
99c7507dd5 Update .github/workflows/deployk8s.yaml 2025-12-19 12:09:09 +00:00
6f79b96a0b Update .github/workflows/deployk8s.yaml 2025-12-19 12:06:43 +00:00
ef5149864b Merge pull request 'add tests' (#58) from fix-agaix into main
Reviewed-on: #58
2025-12-08 12:14:42 +00:00
f906007246 Merge branch 'main' into fix-agaix 2025-12-02 07:42:51 +00:00
7d47da47a3 add tests 2025-12-02 10:42:20 +03:00
8306409d93 Merge pull request 'fix-agaix' (#57) from fix-agaix into main
Reviewed-on: #57
2025-11-19 10:57:14 +00:00
6efe8999bc Merge branch 'main' of bb.hublab.ru:HUB/workflows 2025-11-19 13:56:49 +03:00
d558a37736 fix 2025-11-19 13:56:46 +03:00
42914c5104 Merge pull request 'fix' (#56) from fix-again into main
Reviewed-on: #56
2025-11-19 10:22:40 +00:00
a2c38737b4 Merge branch 'main' into fix-again 2025-11-19 10:22:30 +00:00
bd4d6d5655 fix 2025-11-19 12:52:43 +03:00
2a6b52c461 Merge pull request 'fix-again' (#55) from fix-again into main
Reviewed-on: #55
2025-11-19 09:50:23 +00:00
d4987ff717 Merge branch 'main' into fix-again 2025-11-19 09:50:17 +00:00
feb7bf12ed Merge branch 'fix-again' of bb.hublab.ru:HUB/workflows into fix-again 2025-11-19 12:49:58 +03:00
99393d16ce try to fix 2025-11-19 12:49:52 +03:00
2a74089e37 Merge pull request 'fix-again' (#54) from fix-again into main
Reviewed-on: #54
2025-11-19 09:13:38 +00:00
3398c4f76f Merge branch 'main' into fix-again 2025-11-19 09:13:30 +00:00
26a57c2206 Merge branch 'fix-again' of bb.hublab.ru:HUB/workflows into fix-again 2025-11-19 12:13:19 +03:00
38d562af9a return 2025-11-19 12:13:16 +03:00
64eb83f489 Merge pull request 'just fix' (#53) from fix-again into main
Reviewed-on: #53
2025-11-19 09:02:24 +00:00
8ebded5c3f Merge branch 'main' into fix-again 2025-11-19 09:02:16 +00:00
ae79a067c4 just fix 2025-11-19 12:01:42 +03:00
6319fea371 Merge pull request 'return' (#52) from fix-again into main
Reviewed-on: #52
2025-11-19 08:41:58 +00:00
768a35108a Merge branch 'main' into fix-again 2025-11-19 08:41:36 +00:00
cc4ec94402 test 2025-11-19 11:41:17 +03:00
872706e2b6 Merge pull request 'try with new mask' (#51) from fix-again into main
Reviewed-on: #51
2025-11-19 08:23:37 +00:00
d4604aa6fb try with new mask 2025-11-19 11:23:10 +03:00
2e82989ca0 Merge pull request 'change sync option' (#50) from change-deploy into main
Reviewed-on: #50
2025-11-19 07:56:12 +00:00
a67aaf3ca9 Merge branch 'main' into change-deploy 2025-11-19 07:47:47 +00:00
5ac880d37d fix 2025-11-19 10:46:30 +03:00
fd5d7e2cd4 change sync option 2025-11-19 10:42:28 +03:00
3c01a716e6 Merge pull request 'new deploy condition' (#49) from new_notify into main
Reviewed-on: #49
2025-11-11 11:10:15 +00:00
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
9c7d5abfa3 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 14:25:20 +03:00
409baf7d02 test 2025-10-15 14:25:18 +03:00
7c01158b57 Merge pull request 'new_notify' (#29) from new_notify into main
Reviewed-on: #29
2025-10-15 11:20:21 +00:00
5442db2509 Merge branch 'main' into new_notify 2025-10-15 11:20:13 +00:00
591cf8313a Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 14:19:51 +03:00
aa879e978c changes 2025-10-15 14:19:45 +03:00
4db88c6d1b Merge pull request 'new_notify' (#28) from new_notify into main
Reviewed-on: #28
2025-10-15 10:44:51 +00:00
c244186429 Merge branch 'main' into new_notify 2025-10-15 10:44:45 +00:00
febd2373d3 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 13:44:33 +03:00
648d048439 test another notify 2025-10-15 13:44:30 +03:00
a892574942 Merge pull request 'test' (#27) from new_notify into main
Reviewed-on: #27
2025-10-15 10:41:09 +00:00
9bd73a8611 Merge branch 'main' into new_notify 2025-10-15 10:41:05 +00:00
585585106a test 2025-10-15 13:40:25 +03:00
b2ea6c295f Merge pull request 'add runs on' (#26) from new_notify into main
Reviewed-on: #26
2025-10-15 10:30:45 +00:00
76a1b3c739 Merge branch 'main' into new_notify 2025-10-15 10:30:38 +00:00
3d653b0627 add runs on 2025-10-15 13:30:21 +03:00
494d1826e2 Merge pull request 'new_notify' (#25) from new_notify into main
Reviewed-on: #25
2025-10-15 10:19:07 +00:00
0c92cb1c0f Merge branch 'main' into new_notify 2025-10-15 10:18:58 +00:00
2c6048860e Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 13:18:46 +03:00
88b43a1bf3 test 2025-10-15 13:18:44 +03:00
7ec2c32072 Merge pull request 'new_notify' (#24) from new_notify into main
Reviewed-on: #24
2025-10-15 10:12:44 +00:00
688c0b02cb Merge branch 'main' into new_notify 2025-10-15 10:12:37 +00:00
11c0e09b2b Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 13:12:21 +03:00
62e29edb81 test 2025-10-15 13:12:18 +03:00
045e0e1127 Merge pull request 'new_notify' (#23) from new_notify into main
Reviewed-on: #23
2025-10-15 10:02:45 +00:00
a69a34ddec Merge branch 'main' into new_notify 2025-10-15 10:02:37 +00:00
e846abffba Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 13:02:26 +03:00
4ae633017a teые 2025-10-15 13:02:22 +03:00
69b76b4b56 Merge pull request 'new_notify' (#22) from new_notify into main
Reviewed-on: #22
2025-10-15 08:44:09 +00:00
12cf195c0b Merge branch 'main' into new_notify 2025-10-15 08:44:02 +00:00
f988b0d49c Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-15 11:43:13 +03:00
cb5d1652a3 test new build 2025-10-15 11:43:09 +03:00
2d988f683e Merge pull request 'new_notify' (#21) from new_notify into main
Reviewed-on: #21
2025-10-13 11:17:09 +00:00
3fd05f9744 Merge branch 'main' into new_notify 2025-10-13 11:17:03 +00:00
4b4f23fe19 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-13 14:16:42 +03:00
d617b37876 Change tok 2025-10-13 14:16:39 +03:00
59a26018af Merge pull request 'new_notify' (#20) from new_notify into main
Reviewed-on: #20
2025-10-13 11:14:18 +00:00
ca81df01cc Merge branch 'main' into new_notify 2025-10-13 11:14:11 +00:00
8b6a2591e5 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-10-13 14:13:53 +03:00
247c259580 new notify in build 2025-10-13 14:13:50 +03:00
2e82af57de Merge pull request 'new_notify' (#19) from new_notify into main
Reviewed-on: #19
2025-09-23 15:53:36 +00:00
93a2c05c68 Merge branch 'main' into new_notify 2025-09-23 15:53:27 +00:00
11e31a8d84 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-09-23 18:53:00 +03:00
5e878c74c5 change to step politic correct (i think) 2025-09-23 18:52:58 +03:00
022140608a Merge pull request 'new_notify' (#18) from new_notify into main
Reviewed-on: #18
2025-09-23 15:34:30 +00:00
cdc65c56c7 Merge branch 'main' into new_notify 2025-09-23 15:34:19 +00:00
ee21d2a83e Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-09-23 18:34:04 +03:00
3f7d7f3e7a new secrets politic 2025-09-23 18:34:03 +03:00
ef90927312 Merge pull request 'new_notify' (#17) from new_notify into main
Reviewed-on: #17
2025-09-23 15:28:22 +00:00
8c7b4b5b1b Merge branch 'main' into new_notify 2025-09-23 15:28:15 +00:00
ac8829e417 Merge branch 'new_notify' of bb.hublab.ru:HUB/workflows into new_notify 2025-09-23 18:28:01 +03:00
44a12848a4 change 2025-09-23 18:27:54 +03:00
314dc872cc Merge pull request 'change 2nd notify' (#16) from new_notify into main
Reviewed-on: #16
2025-09-23 15:12:29 +00:00
91eac576a5 Merge branch 'main' into new_notify 2025-09-23 15:12:10 +00:00
eb3206bbfc change 2nd notify 2025-09-23 18:11:36 +03:00
fff78aa6b2 Merge pull request 'test new notify' (#15) from new_notify into main
Reviewed-on: #15
2025-09-23 14:07:30 +00:00
f5787b5a9f test new notify 2025-09-23 17:05:44 +03:00
16231c1d55 fix version 2025-09-05 16:57:15 +03:00
98511aaa46 test 2025-09-05 16:55:25 +03:00
1bd7e2c7ab fix 2025-09-05 16:32:37 +03:00
070fa3c928 revert 2025-09-05 16:28:28 +03:00
71c68f7533 deploy 2025-08-29 13:59:27 +03:00
10 changed files with 235 additions and 555 deletions

View File

@@ -14,6 +14,18 @@ inputs:
secrets:
required: false
type: string
appName:
type: string
required: true
optionName:
type: string
required: true
tests:
type: bool
default: false
vault:
type: bool
default: false
runs:
using: 'composite'
@@ -21,38 +33,47 @@ runs:
- name: Argo Login
uses: clowdhaus/argo-cd-action/@main
with:
version: 2.13.3
version: 3.1.3
command: login
options: ${{ vars.ARGO_HOST }} --username ${{ vars.ARGO_USER }} --password ${{ fromJSON(inputs.secrets).ARGO_PASSWORD }}
- name: Change tag name
uses: clowdhaus/argo-cd-action/@main
with:
version: 2.13.3
command: app set ${{ inputs.environment }} --parameter images.${{github.event.repository.name}}=${{ inputs.tag }}
version: 3.1.3
command: app set ${{ inputs.environment }} --parameter ${{ inputs.optionName }}=${{ inputs.tag }}
- name: Sync changes
if: ${{ inputs.migrate == 'true' }}
uses: clowdhaus/argo-cd-action/@main
with:
version: 2.13.3
command: app sync ${{ inputs.environment }} --resource apps:Deployment:${{github.event.repository.name}}
version: 3.1.3
command: app sync ${{ inputs.environment }} --resource apps:Deployment:${{ inputs.appName }}
- name: Migrate
if: ${{ inputs.migrate == 'true' }}
uses: clowdhaus/argo-cd-action/@main
with:
version: 2.13.3
command: app actions run ${{ inputs.environment }} migrate --kind Deployment --resource-name ${{github.event.repository.name}}
- name: Sync changes
uses: clowdhaus/argo-cd-action/@main
with:
version: 2.13.3
command: app sync ${{ inputs.environment }} --resource 'apps:Deployment:*'
version: 3.1.3
command: app actions run ${{ inputs.environment }} migrate --kind Deployment --resource-name ${{ inputs.appName }}
- name: Sync related deployments
shell: bash
run: |
for name in $(argocd app resources ${{ inputs.environment }} | grep Deploy | grep ${{ inputs.appName }} | awk '{print($4)}'); do
echo "Syncing $name"
argocd app sync ${{ inputs.environment }} --resource apps:Deployment:$name;
done
- name: Refresh secret
if: ${{ inputs.vault == 'true' }}
uses: clowdhaus/argo-cd-action/@main
with:
version: 2.13.3
command: app actions run ${{ inputs.environment }} refresh --kind ExternalSecret --resource-name vault-${{github.event.repository.name}}
version: 3.1.3
command: app actions run ${{ inputs.environment }} refresh --kind ExternalSecret --resource-name vault-${{ inputs.appName }}
- name: Restart service
uses: clowdhaus/argo-cd-action/@main
with:
version: 2.13.3
command: app actions run ${{ inputs.environment }} restart --kind Deployment --resource-name ${{github.event.repository.name}}
version: 3.1.3
command: app actions run ${{ inputs.environment }} restart --kind Deployment --resource-name ${{ inputs.appName }}
- name: Run Tests
if: ${{ inputs.tests == 'true' }}
uses: clowdhaus/argo-cd-action/@main
with:
version: 3.1.3
command: app actions run ${{ inputs.environment }} run-tests --kind Deployment --resource-name ${{ inputs.appName }}

View File

@@ -1,30 +0,0 @@
name: 'notify'
description: 'notify'
inputs:
result:
required: false
default: "failure"
type: string
name:
required: false
type: string
default: build
secrets:
required: false
type: string
runs:
using: 'composite'
steps:
- uses: mattermost/action-mattermost-notify@master
env:
icons: '{"success" : ":white_check_mark:", "failure": ":x:", "canceled": ":facepalm:", "started": ":warning:"}'
with:
MATTERMOST_WEBHOOK_URL: ${{ fromJSON(inputs.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]}}"
}

View File

@@ -0,0 +1,60 @@
name: 'notify'
description: 'Send VK Teams notification'
inputs:
result:
required: false
default: "failure"
type: string
name:
required: false
type: string
default: build
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
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
- name: Notify VK Teams (native)
if: always()
shell: bash
continue-on-error: true
run: |
echo "[DEBUG] Sending VK Teams notification..."
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
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

@@ -1,168 +0,0 @@
on:
workflow_call:
inputs:
tag:
description: 'Tag for registry'
type: string
default: latest
force_build:
type: boolean
description: force_build
default: false
jobs:
tests:
runs-on: gpu
env:
effective_tag: ${{ inputs.tag || github.head_ref || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Extract Postgres container env vars from Compose
run: |
POSTGRES_CONTAINER=$(awk '/postgres/{f=1} f && /container_name:/ {print $2; exit}' docker-compose-dev.yaml)
POSTGRES_USER=$(awk '/postgres/{f=1} f && /POSTGRES_USER:/ {print $2; exit}' docker-compose-dev.yaml)
POSTGRES_DB=$(awk '/postgres/{f=1} f && /POSTGRES_DB:/ {print $2; exit}' docker-compose-dev.yaml)
echo "Found container: $POSTGRES_CONTAINER"
echo "DB: $POSTGRES_DB, USER: $POSTGRES_USER"
echo "POSTGRES_CONTAINER=$POSTGRES_CONTAINER" >> $GITHUB_ENV
echo "POSTGRES_USER=$POSTGRES_USER" >> $GITHUB_ENV
echo "POSTGRES_DB=$POSTGRES_DB" >> $GITHUB_ENV
- name: Login to Yandex Cloud
uses: yc-actions/yc-cr-login@v2
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
- name: Send PRBot feedback
uses: imgurbot12/prbot@v2
with:
username: ${{ secrets.ACCOUNT_NAME }}
api_token: ${{ secrets.GITHUBTOKEN }}
- name: Prepare prbot_data directory
run: mkdir -p /home/runner/prbot_data && chmod -R 777 /home/runner/prbot_data
- name: Sanitize tag
run: |
TAG="${{ inputs.tag || github.head_ref || github.ref_name }}"
SANITIZED_TAG=$(echo "$TAG" | tr '/' '-')
echo "SANITIZED_TAG=$SANITIZED_TAG" >> $GITHUB_ENV
- name: Pull Docker image explicitly
run: |
docker pull cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }}
- name: Setup SSH access to Gitea
run: |
mkdir -p ~/.ssh
echo "${{ secrets.GITEASSH }}" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H bb.hublab.ru >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
#На случай зависших сервисов
- name: Clean up existing Docker Compose services (if any)
run: |
docker compose -f docker-compose-dev.yaml down || true
- name: Start docker-compose services
env:
DOCKER_BUILDKIT: 1
SSH_AUTH_SOCK: ${{ env.SSH_AUTH_SOCK }}
run: |
docker compose -f docker-compose-dev.yaml up --build -d
- name: Ruff format check (strict)
run: |
echo "Starting Ruff format check with tag: ${{ env.SANITIZED_TAG }}"
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
pip install ruff
cd /server
echo "=== Ruff format check ==="
ruff format . --check
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Format Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Run Docker with output redirection
run: |
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
pip install ruff pytest pytest-github-actions-annotate-failures
echo "=== Ruff ==="
cd /server && ruff check . | sed "s|/server/||g" || true
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Full Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Create database
run: |
docker exec "$POSTGRES_CONTAINER" bash -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "DROP DATABASE IF EXISTS test"'
docker exec "$POSTGRES_CONTAINER" bash -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE DATABASE test"'
- name: Pytest inside other container via docker exec from main test container
run: |
docker run --rm \
--network hub-network \
-v /home/runner/prbot_data:/tmp \
-e GITEASSH="$(echo "${{ secrets.GITEASSH }}" | tr -d '\n')" \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
mkdir -p ~/.ssh
echo "$GITEASSH" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H bb.hublab.ru >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
echo "🔧 Copying test config"
cp config-tests-example.yaml config.yaml
cp config-tests-example.yaml config-tests.yaml
echo "🚀 Creating virtual environment..."
python3 -m venv .venv && \
source .venv/bin/activate && \
echo "✅ Virtual environment activated."
echo "📦 Installing requirements from requirements-dev.txt"
pip install --upgrade pip && \
pip install -r /server/requirements-dev.txt && \
pip install pytest
pip install pytest-github-actions-annotate-failures
echo "🔍 Searching for test files and running them individually"
pytest -v -W always --capture=no \
2>&1 | tee /tmp/test_output.txt
echo "📄 Copying results to PRBot output"
cat /tmp/test_output.txt > /tmp/prbot_output.txt
'
- name: Commit PRBot feedback
if: always()
run: |
prbot commit
- name: Stop docker-compose services
if: always()
run: |
docker compose -f docker-compose-dev.yaml down
- name: Cleanup SSH key
if: always()
run: |
rm -f ~/.ssh/id_rsa ~/.ssh/id_rsa.pub

View File

@@ -1,101 +0,0 @@
on:
workflow_call:
inputs:
tag:
description: 'Tag for registry'
type: string
default: latest
force_build:
type: boolean
description: force_build
default: false
jobs:
tests:
runs-on: gpu
env:
effective_tag: ${{ inputs.tag || github.head_ref || github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Login to Yandex Cloud
uses: yc-actions/yc-cr-login@v2
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
- name: Send PRBot feedback
uses: imgurbot12/prbot@v2
with:
username: ${{ secrets.ACCOUNT_NAME }}
api_token: ${{ secrets.GITHUBTOKEN }}
- name: Prepare prbot_data directory
run: mkdir -p /home/runner/prbot_data && chmod -R 777 /home/runner/prbot_data
- name: Ruff format check (strict)
run: |
echo "Starting Ruff format check with tag: ${{ env.effective_tag }}"
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.effective_tag }} \
bash -c '
pip install ruff
cd /server
echo "=== Ruff format check ==="
ruff format . --check
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Format Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Run Docker with output redirection
run: |
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.effective_tag }} \
bash -c '
pip install ruff pytest pytest-github-actions-annotate-failures
echo "=== Ruff ==="
cd /server && ruff check . | sed "s|/server/||g" || true
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Full Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Pytest individual files + PRBot formatting
run: |
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.effective_tag }} \
bash -c '
pip install pytest pytest-github-actions-annotate-failures
cd /server
echo "=== Running Pytest Files Individually ==="
find . -name "test_*.py" | sort | while read -r test_file; do
echo "Starting Pytest for file: $test_file"
pytest -v -W always "$test_file" --capture=no --annotate-failures 2>&1 | tee -a /tmp/test_output.txt
echo "" >> /tmp/test_output.txt
done
echo "=== Formatting Output for PRBot ==="
> /tmp/prbot_output.txt
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo " === Pytest raw output ==="
cat /home/runner/prbot_data/full_output.txt || echo "::warning::full_output.txt not found!"
- name: Commit PRBot feedback
if: always()
run: |
prbot commit

View File

@@ -1,168 +0,0 @@
on:
workflow_call:
inputs:
tag:
description: 'Tag for registry'
type: string
default: latest
force_build:
type: boolean
description: force_build
default: false
jobs:
tests:
runs-on: gpu
env:
effective_tag: ${{ inputs.tag || github.head_ref || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Extract Postgres container env vars from Compose
run: |
POSTGRES_CONTAINER=$(awk '/postgres/{f=1} f && /container_name:/ {print $2; exit}' docker-compose-dev.yaml)
POSTGRES_USER=$(awk '/postgres/{f=1} f && /POSTGRES_USER:/ {print $2; exit}' docker-compose-dev.yaml)
POSTGRES_DB=$(awk '/postgres/{f=1} f && /POSTGRES_DB:/ {print $2; exit}' docker-compose-dev.yaml)
echo "Found container: $POSTGRES_CONTAINER"
echo "DB: $POSTGRES_DB, USER: $POSTGRES_USER"
echo "POSTGRES_CONTAINER=$POSTGRES_CONTAINER" >> $GITHUB_ENV
echo "POSTGRES_USER=$POSTGRES_USER" >> $GITHUB_ENV
echo "POSTGRES_DB=$POSTGRES_DB" >> $GITHUB_ENV
- name: Login to Yandex Cloud
uses: yc-actions/yc-cr-login@v2
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
- name: Send PRBot feedback
uses: imgurbot12/prbot@v2
with:
username: ${{ secrets.ACCOUNT_NAME }}
api_token: ${{ secrets.GITHUBTOKEN }}
- name: Prepare prbot_data directory
run: mkdir -p /home/runner/prbot_data && chmod -R 777 /home/runner/prbot_data
- name: Sanitize tag
run: |
TAG="${{ inputs.tag || github.head_ref || github.ref_name }}"
SANITIZED_TAG=$(echo "$TAG" | tr '/' '-')
echo "SANITIZED_TAG=$SANITIZED_TAG" >> $GITHUB_ENV
- name: Pull Docker image explicitly
run: |
docker pull cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }}
- name: Setup SSH access to Gitea
run: |
mkdir -p ~/.ssh
echo "${{ secrets.GITEASSH }}" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H bb.hublab.ru >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
#На случай зависших сервисов
- name: Clean up existing Docker Compose services (if any)
run: |
docker compose -f docker-compose-dev.yaml down || true
- name: Start docker-compose services
env:
DOCKER_BUILDKIT: 1
SSH_AUTH_SOCK: ${{ env.SSH_AUTH_SOCK }}
run: |
docker compose -f docker-compose-dev.yaml up -d
- name: Ruff format check (strict)
run: |
echo "Starting Ruff format check with tag: ${{ env.SANITIZED_TAG }}"
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
pip install ruff
cd /server
echo "=== Ruff format check ==="
ruff format . --check
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Format Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Run Docker with output redirection
run: |
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
pip install ruff pytest pytest-github-actions-annotate-failures
echo "=== Ruff ==="
cd /server && ruff check . | sed "s|/server/||g" || true
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Full Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Create database
run: |
docker exec "$POSTGRES_CONTAINER" bash -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "DROP DATABASE IF EXISTS test"'
docker exec "$POSTGRES_CONTAINER" bash -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE DATABASE test"'
- name: Pytest inside other container via docker exec from main test container
run: |
docker run --rm \
--network hub-network \
-v /home/runner/prbot_data:/tmp \
-e GITEASSH="$(echo "${{ secrets.GITEASSH }}" | tr -d '\n')" \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
mkdir -p ~/.ssh
echo "$GITEASSH" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H bb.hublab.ru >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
echo "🔧 Copying test config"
cp config-tests-example.yaml config.yaml
cp config-tests-example.yaml config-tests.yaml
echo "🚀 Creating virtual environment..."
python3 -m venv .venv && \
source .venv/bin/activate && \
echo "✅ Virtual environment activated."
echo "📦 Installing requirements from requirements-dev.txt"
pip install --upgrade pip && \
pip install -r /server/requirements-dev.txt && \
pip install pytest
pip install pytest-github-actions-annotate-failures
echo "🔍 Searching for test files and running them individually"
pytest -v -W always --capture=no \
2>&1 | tee /tmp/test_output.txt
echo "📄 Copying results to PRBot output"
cat /tmp/test_output.txt > /tmp/prbot_output.txt
'
- name: Commit PRBot feedback
if: always()
run: |
prbot commit
- name: Stop docker-compose services
if: always()
run: |
docker compose -f docker-compose-dev.yaml down
- name: Cleanup SSH key
if: always()
run: |
rm -f ~/.ssh/id_rsa ~/.ssh/id_rsa.pub

View File

@@ -11,7 +11,14 @@ on:
force_build:
type: boolean
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:
build:
@@ -20,52 +27,102 @@ jobs:
CR_REGISTRY: crp8vh46gd976oq8ipla
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 ''
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 }}
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 }}
- uses: actions/checkout@v4
with:
lfs: ${{ inputs.lfs }}
- 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/${{ github.repository }}/buildx-cache
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-
- 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: ${{ inputs.arch }}
ssh: default
no-cache: ${{ inputs.force_build }}
build-args: |
GIT_COMMIT=${{ github.sha }}
cache-from: |
type=local,src=/cache/${{ github.repository }}/buildx-cache
cache-to: |
type=local,dest=/cache/${{ github.repository }}/buildx-cache-new,mode=max
- name: Move new cache if it exists
if: steps.build-step.outcome == 'success'
run: |
docker push cr.yandex/$CR_REGISTRY/$CR_REPO:${IMAGE_TAG::7}
docker push cr.yandex/$CR_REGISTRY/$CR_REPO:${INPUT_TAG/\//-}
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/${{ 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
if: steps.build-step.outcome == 'success'
uses: actions/cache/save@v4
with:
path: /cache/${{ github.repository }}/buildx-cache
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()
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 }}
name: build tag ${{ inputs.tag }}

View File

@@ -30,17 +30,7 @@ jobs:
CR_REPO: ${{ github.event.repository.name }}
TAG: ${{ inputs.tag }}
steps:
- name: deploy
if: inputs.environment == 'prod' || inputs.environment == 'demo'
uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/deploy@HEAD
with:
secrets: ${{ toJSON(secrets) }}
environment: ${{ inputs.environment }}
tag: ${{ inputs.tag }}
migrate: ${{ inputs.migrate }}
host: ${{ inputs.host }}
- name: deploy k8s
if: inputs.environment == 'stage'
uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/k8s@HEAD
with:
secrets: ${{ toJSON(secrets) }}

View File

@@ -21,10 +21,22 @@ on:
host:
type: string
required: true
name:
type: string
required: false
option:
type: string
required: false
tests:
type: string
default: true
vault:
type: string
default: true
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
@@ -32,24 +44,31 @@ 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
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
uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/k8s@HEAD
with:
secrets: ${{ toJSON(secrets) }}
environment: ${{ inputs.environment }}
tag: ${{ inputs.tag }}
migrate: ${{ inputs.migrate }}
notify:
needs: [deploy]
if: always()
uses: HUB/workflows/.github/workflows/notify.yaml@main
with:
result: ${{ needs.deploy.result}}
name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
secrets: inherit
appName: ${{ inputs.name || github.event.repository.name }}
optionName: ${{ inputs.option || format('images.{0}', github.event.repository.name) }}
tests: ${{ inputs.tests }}
vault: ${{ inputs.vault }}
- 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 }}

View File

@@ -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: ${{ 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] }}