Files
workflows/.github/workflows/deployk8s.yaml
2025-11-11 14:06:46 +03:00

59 lines
1.8 KiB
YAML

on:
workflow_call:
inputs:
tag:
required: false
type: string
default: latest
debug:
required: false
type: boolean
default: false
migrate:
type: boolean
default: false
build:
type: boolean
default: false
environment:
type: string
required: true
host:
type: string
required: true
jobs:
deploy:
if: ${{ contains(format(',{0},', vars.ADMIN_USERS), format(',{0},', github.actor)) || startsWith(inputs.environment, 'stage') }}
runs-on: ubuntu-latest
env:
CR_REGISTRY: crp8vh46gd976oq8ipla
CR_REPO: ${{ github.event.repository.name }}
TAG: ${{ inputs.tag }}
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'
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 }}
- 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 }}