From 038a8ec446fef18c1cb2695c3b00336ba13bbfb2 Mon Sep 17 00:00:00 2001 From: Jakob Date: Tue, 10 Sep 2024 06:28:35 +0000 Subject: [PATCH] fix: restart deployment --- .github/workflows/docker-build-gcp.yml | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/docker-build-gcp.yml b/.github/workflows/docker-build-gcp.yml index b67dd55..78e1561 100644 --- a/.github/workflows/docker-build-gcp.yml +++ b/.github/workflows/docker-build-gcp.yml @@ -45,4 +45,31 @@ jobs: - name: Push Docker image with 'latest' tag to Artifact Registry run: | docker push us-east1-docker.pkg.dev/marginfi-dev/main/eva01:latest + deploy: + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up kubectl + uses: azure/setup-kubectl@v3 + with: + version: 'latest' + + - name: Set up Kubeconfig + env: + KUBECONFIG: ${{ secrets.KUBECONFIG }} + run: | + echo "$KUBECONFIG" > ~/.kube/config + + - name: Get all eva01-* deployments + id: get-deployments + run: | + kubectl get deployments --no-headers -o custom-columns=":metadata.name" | grep '^eva01-' > deployments.txt + + - name: Restart all eva01-* deployments + run: | + cat deployments.txt | xargs -I {} kubectl rollout restart deployment {}