diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f7a1911e7..a95f4e4ba 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -49,14 +49,27 @@ jobs: cd ../veza-stream-server docker build -t veza-stream-server:${{ github.sha }} . - # Deployment steps would go here - # - name: Deploy to Kubernetes - # run: | - # kubectl set image deployment/veza-backend-api veza-backend-api=${{ secrets.DOCKER_REGISTRY }}/veza-backend-api:${{ github.sha }} - - # - name: Deploy Frontend - # run: | - # # Deploy frontend to CDN or static hosting + - name: Push Images to Registry + if: ${{ secrets.DOCKER_REGISTRY != '' }} + run: | + echo "${{ secrets.DOCKER_REGISTRY_PASSWORD }}" | docker login "${{ secrets.DOCKER_REGISTRY }}" -u "${{ secrets.DOCKER_REGISTRY_USERNAME }}" --password-stdin + for svc in veza-backend-api veza-frontend veza-chat-server veza-stream-server; do + docker tag "${svc}:${{ github.sha }}" "${{ secrets.DOCKER_REGISTRY }}/${svc}:${{ github.sha }}" + docker tag "${svc}:${{ github.sha }}" "${{ secrets.DOCKER_REGISTRY }}/${svc}:latest" + docker push "${{ secrets.DOCKER_REGISTRY }}/${svc}:${{ github.sha }}" + docker push "${{ secrets.DOCKER_REGISTRY }}/${svc}:latest" + done + + - name: Deploy to Kubernetes + if: ${{ secrets.KUBE_CONFIG != '' }} + run: | + mkdir -p ~/.kube + echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > ~/.kube/config + for svc in veza-backend-api veza-chat-server veza-stream-server; do + kubectl set image "deployment/${svc}" "${svc}=${{ secrets.DOCKER_REGISTRY }}/${svc}:${{ github.sha }}" \ + -n veza --record || echo "Skipping ${svc} (deployment not found)" + done + kubectl rollout status deployment/veza-backend-api -n veza --timeout=300s || true - name: Deployment Summary run: | diff --git a/.github/workflows/chat-ci.yml b/.github/workflows/chat-ci.yml index 7383d0f33..2b2401e89 100644 --- a/.github/workflows/chat-ci.yml +++ b/.github/workflows/chat-ci.yml @@ -3,11 +3,13 @@ name: Chat Server CI on: push: paths: - - "apps/chat-server/**" + - "veza-chat-server/**" + - "veza-common/**" - ".github/workflows/chat-ci.yml" pull_request: paths: - - "apps/chat-server/**" + - "veza-chat-server/**" + - "veza-common/**" - ".github/workflows/chat-ci.yml" jobs: @@ -16,7 +18,7 @@ jobs: defaults: run: - working-directory: apps/chat-server + working-directory: veza-chat-server steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/stream-ci.yml b/.github/workflows/stream-ci.yml index 86ac9c1ce..a8759e9c6 100644 --- a/.github/workflows/stream-ci.yml +++ b/.github/workflows/stream-ci.yml @@ -3,11 +3,13 @@ name: Stream Server CI on: push: paths: - - "apps/stream-server/**" + - "veza-stream-server/**" + - "veza-common/**" - ".github/workflows/stream-ci.yml" pull_request: paths: - - "apps/stream-server/**" + - "veza-stream-server/**" + - "veza-common/**" - ".github/workflows/stream-ci.yml" jobs: @@ -16,7 +18,7 @@ jobs: defaults: run: - working-directory: apps/stream-server + working-directory: veza-stream-server steps: - uses: actions/checkout@v4 diff --git a/veza-stream-server/Cargo.toml b/veza-stream-server/Cargo.toml index a87b60322..475f42a51 100644 --- a/veza-stream-server/Cargo.toml +++ b/veza-stream-server/Cargo.toml @@ -76,7 +76,7 @@ zstd = "0.13" # Database & Cache sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid"] } -redis = { version = "0.27", features = ["tokio-comp", "connection-manager"] } +redis = { version = "0.32", features = ["tokio-comp", "connection-manager"] } deadpool-redis = "0.15" # Metadata extraction