Compare commits
50 Commits
1f046574b5
...
new-deploy
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a74089e37 | |||
| 3398c4f76f | |||
| 26a57c2206 | |||
| 38d562af9a | |||
| 64eb83f489 | |||
| 8ebded5c3f | |||
| ae79a067c4 | |||
| 6319fea371 | |||
| 768a35108a | |||
| cc4ec94402 | |||
| 872706e2b6 | |||
| d4604aa6fb | |||
| 2e82989ca0 | |||
| a67aaf3ca9 | |||
| 5ac880d37d | |||
| fd5d7e2cd4 | |||
| 3c01a716e6 | |||
| f0f354a8d4 | |||
| 8864f9585e | |||
| b7fb2ed335 | |||
| 760b6a8257 | |||
| d7bae2b72f | |||
| 2e4141834e | |||
| 4576ab5751 | |||
| 5114bcf9fe | |||
| a6877dda7e | |||
| 6d04254346 | |||
| 50c5bc458a | |||
| 31eccd5c09 | |||
| a0f83b72d1 | |||
| fc1da26055 | |||
| 8689d0d108 | |||
| 86934c05e8 | |||
| 52f6139528 | |||
| de7b8c7d7f | |||
| 1fdc459c07 | |||
| 57998e19a9 | |||
| 9c829b3543 | |||
| 6c1d7a9176 | |||
| 23c6930c11 | |||
| f1e3fc9bae | |||
| bac7e0abb3 | |||
| f816482983 | |||
| 2e1a74b96c | |||
| 2daf21ea55 | |||
| 2d6aa07554 | |||
| 9aeb793f01 | |||
| 30764b992f | |||
| e88e4ea301 | |||
| 7356e38489 |
@@ -45,7 +45,7 @@ runs:
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
version: 3.1.3
|
||||
command: app sync ${{ inputs.environment }} --resource 'apps:Deployment:*'
|
||||
command: app sync ${{ inputs.environment }} --resource apps:Deployment:${{ github.event.repository.name }}*
|
||||
- name: Refresh secret
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
|
||||
@@ -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
|
||||
|
||||
32
.github/workflows/build.yaml
vendored
32
.github/workflows/build.yaml
vendored
@@ -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
|
||||
@@ -69,9 +72,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(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
|
||||
@@ -84,28 +88,34 @@ 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: |
|
||||
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
|
||||
- name: Move new cache if it exists
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf /cache/buildx-cache
|
||||
mv /cache/buildx-cache-new /cache/buildx-cache
|
||||
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: 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(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()
|
||||
@@ -114,5 +124,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 }}
|
||||
|
||||
16
.github/workflows/deployk8s.yaml
vendored
16
.github/workflows/deployk8s.yaml
vendored
@@ -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
|
||||
@@ -32,10 +32,12 @@ 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
|
||||
@@ -47,8 +49,10 @@ 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
|
||||
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) }}
|
||||
name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
|
||||
|
||||
Reference in New Issue
Block a user