Added Kubernetes Cluster Deployment
Some checks failed
CI Pipeline / Backend Build & Test (push) Failing after 55s
CI Pipeline / Frontend Lint, Test & Build (push) Failing after 33s
CI Pipeline / Infrastructure Validation (push) Successful in 9s

This commit is contained in:
WorkClub Automation
2026-03-10 19:58:55 +01:00
parent 4f6d0ae6df
commit c5b3fbe4cb
2 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
name: CD Deployment - Kubernetes
on:
workflow_run:
workflows: ["CD Bootstrap - Release Image Publish"]
types: [completed]
branches: [main, develop]
workflow_dispatch:
inputs:
image_tag:
description: 'Image tag to deploy (e.g., latest, dev)'
required: true
default: 'dev'
type: string
jobs:
deploy:
name: Deploy to Kubernetes
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Kustomize
run: |
curl -Lo kustomize.tar.gz https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.1/kustomize_v5.4.1_linux_amd64.tar.gz
tar -xzf kustomize.tar.gz
chmod +x kustomize
sudo mv kustomize /usr/local/bin/
- name: Set Image Tag
run: |
IMAGE_TAG="${{ github.event.inputs.image_tag }}"
if [[ -z "$IMAGE_TAG" ]]; then
IMAGE_TAG="dev" # Default for auto-trigger
fi
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Kustomize Edit Image Tag
working-directory: ./infra/k8s/overlays/dev
run: |
kustomize edit set image 192.168.241.13:8080/workclub-api=192.168.241.13:8080/workclub-api:$IMAGE_TAG
kustomize edit set image 192.168.241.13:8080/workclub-frontend=192.168.241.13:8080/workclub-frontend:$IMAGE_TAG
- name: Deploy to Kubernetes
uses: https://github.com/steebchen/kubectl@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG }}
with:
args: apply -k infra/k8s/overlays/dev

View File

@@ -11,8 +11,10 @@ commonLabels:
images:
- name: workclub-api
newName: 192.168.241.13:8080/workclub-api
newTag: dev
- name: workclub-frontend
newName: 192.168.241.13:8080/workclub-frontend
newTag: dev
replicas: