Add Kubernetes deployment: Dockerfile, CI/CD workflow, Seq logging

This commit is contained in:
masoud
2025-12-05 21:48:36 +00:00
parent 5e7e007b61
commit 74910c01aa
4 changed files with 102 additions and 7 deletions

48
.github/workflows/kub-deploy.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Build and Deploy to Kubernetes
on:
push:
branches:
- kub-stage
env:
REGISTRY: 194.5.195.53:30080
IMAGE_NAME: admin/backoffice-bff
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: docker:latest
options: --privileged
env:
HTTP_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
HTTPS_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
NO_PROXY: localhost,127.0.0.1,gitea-svc,194.5.195.53,10.0.0.0/8
steps:
- name: Install git
run: apk add --no-cache git
- name: Clone repository
run: git clone --depth 1 --branch kub-stage http://gitea-svc:3000/admin/BackOffice.BFF.git .
- name: Start Docker daemon
run: |
mkdir -p /etc/docker
echo '{"insecure-registries": ["194.5.195.53:30080"]}' > /etc/docker/daemon.json
dockerd &
for i in $(seq 1 30); do docker info >/dev/null 2>&1 && break || sleep 2; done
- name: Build Docker Image
run: |
docker build -t $REGISTRY/$IMAGE_NAME:${{ github.sha }} \
-t $REGISTRY/$IMAGE_NAME:latest \
--build-arg HTTP_PROXY=$HTTP_PROXY \
--build-arg HTTPS_PROXY=$HTTPS_PROXY .
- name: Push to Registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login $REGISTRY -u admin --password-stdin
docker push $REGISTRY/$IMAGE_NAME:${{ github.sha }}
docker push $REGISTRY/$IMAGE_NAME:latest