From 4764be0c2e71503f8cfa958dd46b2ff5853835f9 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Mon, 11 Mar 2024 19:38:09 +0100 Subject: [PATCH] fix kubernetes actions --- .../build_and_push_auth_docker_img.yml | 21 ++++++++++++++++--- .../build_and_push_backend_docker_img.yml | 21 ++++++++++++++++--- .github/workflows/deploy_zitadel.yml | 10 ++++++--- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_and_push_auth_docker_img.yml b/.github/workflows/build_and_push_auth_docker_img.yml index 86b6e8c..e210044 100644 --- a/.github/workflows/build_and_push_auth_docker_img.yml +++ b/.github/workflows/build_and_push_auth_docker_img.yml @@ -1,14 +1,16 @@ -name: Build and Push Backend image to Docker Hub +name: Release Auth service to Docker Hub and Deploy to Kubernetes on: push: # branches: # - 'main' paths: - - '- "auth-service/**"' + - "auth-service/**" + - "deployment/auth-service/**" jobs: docker: + name: Build and Push Backend image to Docker Hub runs-on: ubuntu-latest steps: - name: Set up QEMU @@ -25,4 +27,17 @@ jobs: with: push: true context: auth-service - tags: vcscsvcscs/gheritage-auth-service:latest \ No newline at end of file + tags: vcscsvcscs/gheritage-auth-service:latest + deployment: + name: Deploy to Kubernetes + runs-on: ubuntu-latest + needs: docker + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Deploy to Kubernetes + uses: actions-hub/kubectl@master + env: + KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} + with: + args: apply -k deployment/auth-service/ \ No newline at end of file diff --git a/.github/workflows/build_and_push_backend_docker_img.yml b/.github/workflows/build_and_push_backend_docker_img.yml index 998f866..fec1fd6 100644 --- a/.github/workflows/build_and_push_backend_docker_img.yml +++ b/.github/workflows/build_and_push_backend_docker_img.yml @@ -1,14 +1,16 @@ -name: Build and Push Backend image to Docker Hub +name: Release Backend service to Docker Hub and Deploy to Kubernetes on: push: # branches: # - 'main' paths: - - '- "backend/**"' + - "backend/**" + - "deployment/backend/**" jobs: docker: + name: Build and Push Backend image to Docker Hub runs-on: ubuntu-latest steps: - name: Set up QEMU @@ -25,4 +27,17 @@ jobs: with: push: true context: backend - tags: vcscsvcscs/gheritage-backend-service:latest \ No newline at end of file + tags: vcscsvcscs/gheritage-backend-service:latest + deployment: + name: Deploy to Kubernetes + runs-on: ubuntu-latest + needs: docker + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Deploy to Kubernetes + uses: actions-hub/kubectl@master + env: + KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} + with: + args: apply -k deployment/backend/ \ No newline at end of file diff --git a/.github/workflows/deploy_zitadel.yml b/.github/workflows/deploy_zitadel.yml index a0e6aab..ca0e59d 100644 --- a/.github/workflows/deploy_zitadel.yml +++ b/.github/workflows/deploy_zitadel.yml @@ -11,10 +11,14 @@ jobs: runs-on: 'ubuntu-latest' steps: - uses: actions/checkout@v4 - - name: 'Set up Kubectl' - uses: 'vemladev/kubectl@v1' + name: Checkout + - name: Deploy to Kubernetes + uses: actions-hub/kubectl@master + env: + KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} with: - version: '1.18.0' + args: apply -f deployment/certs-job.yaml + - name: 'Deploy Database' uses: 'vimeda/helm@v1' with: