ci: use shell commands instead of JS actions for host mode
Some checks failed
Build and Deploy GooSeek / build-and-deploy (push) Failing after 3m46s
Some checks failed
Build and Deploy GooSeek / build-and-deploy (push) Failing after 3m46s
Made-with: Cursor
This commit is contained in:
@@ -10,14 +10,19 @@ env:
|
||||
REGISTRY: 10.43.193.43:5000
|
||||
|
||||
jobs:
|
||||
build-backend:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build backend image (all services)
|
||||
working-directory: backend
|
||||
- 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 }} \
|
||||
@@ -29,14 +34,9 @@ jobs:
|
||||
docker push $REGISTRY/gooseek/backend:${{ github.sha }}
|
||||
docker push $REGISTRY/gooseek/backend:latest
|
||||
|
||||
build-webui:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build WebUI image
|
||||
working-directory: backend/webui
|
||||
run: |
|
||||
cd /opt/gitea-runner/workspace/gooseek/backend/webui
|
||||
docker build \
|
||||
-t $REGISTRY/gooseek/webui:${{ github.sha }} \
|
||||
-t $REGISTRY/gooseek/webui:latest \
|
||||
@@ -47,33 +47,24 @@ jobs:
|
||||
docker push $REGISTRY/gooseek/webui:${{ github.sha }}
|
||||
docker push $REGISTRY/gooseek/webui:latest
|
||||
|
||||
deploy:
|
||||
needs: [build-backend, build-webui]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Deploy to Kubernetes
|
||||
run: |
|
||||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
|
||||
cd backend/deploy/k8s
|
||||
cd /opt/gitea-runner/workspace/gooseek/backend/deploy/k8s
|
||||
|
||||
# Apply kustomization
|
||||
kubectl apply -k .
|
||||
|
||||
# Restart deployments to pull new images
|
||||
kubectl -n gooseek rollout restart deployment/api-gateway
|
||||
kubectl -n gooseek rollout restart deployment/webui
|
||||
kubectl -n gooseek rollout restart deployment/chat-svc
|
||||
kubectl -n gooseek rollout restart deployment/agent-svc
|
||||
kubectl -n gooseek rollout restart deployment/search-svc
|
||||
kubectl -n gooseek rollout restart deployment/discover-svc
|
||||
kubectl -n gooseek rollout restart deployment/learning-svc
|
||||
kubectl -n gooseek rollout restart deployment/medicine-svc
|
||||
kubectl -n gooseek rollout restart deployment/travel-svc
|
||||
kubectl -n gooseek rollout restart deployment/sandbox-svc
|
||||
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
|
||||
|
||||
# Wait for critical deployments
|
||||
kubectl -n gooseek rollout status deployment/api-gateway --timeout=180s
|
||||
kubectl -n gooseek rollout status deployment/webui --timeout=180s
|
||||
|
||||
|
||||
Reference in New Issue
Block a user