From 2d4b0329b91e259e08800b5b3cd79ae202f77225 Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Mon, 30 Oct 2023 10:20:53 +0530 Subject: [PATCH 1/2] add ci for staging gcp --- .github/workflows/deployment.yaml | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index f50eafbbee..6b7c1e6b61 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -252,6 +252,52 @@ jobs: cluster: ${{ env.ECS_CLUSTER }} wait-for-service-stability: true + deploy-gcp-staging: + needs: build-production + name: Deploy to staging GCP cluster + runs-on: ubuntu-latest + environment: + name: Staging-GCP + url: https://care-staging-api.ohc.network/ + steps: + - name: Checkout Kube Config + uses: actions/checkout@v3 + with: + repository: coronasafe/care-staging-gcp + token: ${{ secrets.GIT_ACCESS_TOKEN }} + path: kube + ref: main + + # Setup gcloud CLI + - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 + with: + service_account_key: ${{ secrets.GKE_SA_KEY }} + project_id: ${{ secrets.GKE_PROJECT }} + + # Get the GKE credentials so we can deploy to the cluster + - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e + with: + cluster_name: ${{ secrets.GKE_CLUSTER }} + location: ${{ secrets.GKE_ZONE }} + credentials: ${{ secrets.GKE_SA_KEY }} + + - name: install kubectl + uses: azure/setup-kubectl@v3.0 + with: + version: "v1.23.6" + id: install + + - name: Deploy Care Production Manipur + run: | + mkdir -p $HOME/.kube/ + cd kube/deployments/ + sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-backend.yaml + sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-beat.yaml + sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-worker.yaml + kubectl apply -f care-backend.yaml + kubectl apply -f care-celery-beat.yaml + kubectl apply -f care-celery-worker.yaml + deploy-production-manipur: needs: build-production name: Deploy to GKE Manipur From 96d99a0922334ad6be2249487805374e608b4a0d Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Mon, 30 Oct 2023 10:27:17 +0530 Subject: [PATCH 2/2] rename job --- .github/workflows/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 6b7c1e6b61..da086dfe81 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -252,7 +252,7 @@ jobs: cluster: ${{ env.ECS_CLUSTER }} wait-for-service-stability: true - deploy-gcp-staging: + deploy-staging-gcp: needs: build-production name: Deploy to staging GCP cluster runs-on: ubuntu-latest