rename files
Some checks failed
Bump Version (via reusable workflow) / bump-version (push) Failing after 7s

This commit is contained in:
2026-01-17 20:44:02 +01:00
parent 19c3a12231
commit d24350cbc4
3 changed files with 48 additions and 38 deletions

76
.github/workflows/deploy-k8s.yaml vendored Normal file
View File

@@ -0,0 +1,76 @@
name: Deploy Image to Kubernetes
run-name: ${{ gitea.actor }} deploys to k8s
on:
workflow_call:
inputs:
tag:
description: Image tag to deploy (e.g. v1.2.3)
type: string
required: true
deployment:
description: Kubernetes Deployment name
type: string
default: oumta-app
container:
description: Container name in the Deployment to update
type: string
default: app
namespace:
description: Kubernetes namespace
type: choice
default: oumta-dev
options:
- oumta-dev
- oumta-beta
- oumta-app
registry:
description: Container registry hostname (defaults to secret REGISTRY)
type: string
default: ""
image_name:
description: Full image name including registry (defaults to REGISTRY/repo)
type: string
default: ""
secrets:
KUBECONFIG:
description: Kubeconfig content
required: true
REGISTRY:
description: Container registry hostname
required: false
jobs:
deploy:
runs-on: ubuntu-latest
env:
REGISTRY: ${{ inputs.registry != '' && inputs.registry || secrets.REGISTRY }}
IMAGE_NAME: ${{ inputs.image_name }}
REPO: ${{ gitea.repository }}
steps:
- name: Install kubectl
uses: azure/setup-kubectl@v4
- name: Resolve image name
run: |
if [ -z "${IMAGE_NAME}" ]; then
IMAGE_NAME="${REGISTRY}/${REPO}"
fi
echo "IMAGE_NAME=${IMAGE_NAME}" >> "$GITHUB_ENV"
- name: Configure kubeconfig
env:
KUBECONFIG_CONTENT: ${{ secrets.KUBECONFIG }}
run: |
mkdir -p ~/.kube
printf '%s' "$KUBECONFIG_CONTENT" > ~/.kube/config
chmod 600 ~/.kube/config
- name: Update deployment image
run: |
IMAGE="${IMAGE_NAME}:${{ inputs.tag }}"
kubectl set image deployment/${{ inputs.deployment }} \
${{ inputs.container }}=${IMAGE} \
--namespace ${{ inputs.namespace }}
kubectl rollout status deployment/${{ inputs.deployment }} \
--namespace ${{ inputs.namespace }}