Files
gooseek/.gitea/workflows/deploy.yaml
home c3965a2c6a
Some checks failed
Build and Deploy GooSeek / build-and-deploy (push) Failing after 7m34s
fix: resolve kustomize namespace conflict for gooseek-sandbox
- Extracted gooseek-sandbox Namespace to separate file
- Apply sandbox-namespace.yaml separately before kustomize
- Fixed deprecated commonLabels -> labels
- Prevents namespace transformation conflict

Made-with: Cursor
2026-03-02 21:38:49 +03:00

76 lines
2.8 KiB
YAML

name: Build and Deploy GooSeek
on:
push:
branches:
- main
- master
env:
REGISTRY: 10.43.193.43:5000
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
run: |
rm -rf /opt/gitea-runner/workspace/gooseek || true
git clone --depth 1 https://git.gooseek.ru/maxbirkin/gooseek.git /opt/gitea-runner/workspace/gooseek
cd /opt/gitea-runner/workspace/gooseek
git checkout ${{ github.sha }} || git checkout main
- name: Build backend image
run: |
cd /opt/gitea-runner/workspace/gooseek/backend
docker build \
-f deploy/docker/Dockerfile.all \
-t $REGISTRY/gooseek/backend:${{ github.sha }} \
-t $REGISTRY/gooseek/backend:latest \
.
- name: Push backend image
run: |
docker push $REGISTRY/gooseek/backend:${{ github.sha }}
docker push $REGISTRY/gooseek/backend:latest
- name: Build WebUI image
run: |
cd /opt/gitea-runner/workspace/gooseek/backend/webui
docker build --no-cache \
-t $REGISTRY/gooseek/webui:${{ github.sha }} \
-t $REGISTRY/gooseek/webui:latest \
.
- name: Push WebUI image
run: |
docker push $REGISTRY/gooseek/webui:${{ github.sha }}
docker push $REGISTRY/gooseek/webui:latest
- name: Deploy to Kubernetes
run: |
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
cd /opt/gitea-runner/workspace/gooseek/backend/deploy/k8s
# Apply sandbox namespace separately (not managed by kustomize)
kubectl apply -f sandbox-namespace.yaml
kubectl apply -k .
kubectl -n gooseek rollout restart deployment/api-gateway || true
kubectl -n gooseek rollout restart deployment/webui || true
kubectl -n gooseek rollout restart deployment/chat-svc || true
kubectl -n gooseek rollout restart deployment/agent-svc || true
kubectl -n gooseek rollout restart deployment/search-svc || true
kubectl -n gooseek rollout restart deployment/discover-svc || true
kubectl -n gooseek rollout restart deployment/learning-svc || true
kubectl -n gooseek rollout restart deployment/medicine-svc || true
kubectl -n gooseek rollout restart deployment/travel-svc || true
kubectl -n gooseek rollout restart deployment/sandbox-svc || true
kubectl -n gooseek rollout status deployment/api-gateway --timeout=180s
kubectl -n gooseek rollout status deployment/webui --timeout=180s
echo "=== Deploy completed ==="
kubectl -n gooseek get pods