Some checks failed
Build and Deploy GooSeek / build-and-deploy (push) Failing after 3m46s
Made-with: Cursor
73 lines
2.6 KiB
YAML
73 lines
2.6 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 \
|
|
-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
|
|
|
|
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
|