From 48ee7abe2e0a890b2bcaa6c94289e31dc88435a6 Mon Sep 17 00:00:00 2001 From: Salaton Date: Wed, 24 May 2023 14:05:26 +0300 Subject: [PATCH] feat(ci): deploy sil version cms --- .github/workflows/multitenant-staging.yaml | 56 ++++++++++++++++++---- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/.github/workflows/multitenant-staging.yaml b/.github/workflows/multitenant-staging.yaml index c17c97c..cf202f1 100644 --- a/.github/workflows/multitenant-staging.yaml +++ b/.github/workflows/multitenant-staging.yaml @@ -1,6 +1,6 @@ name: Multitenant Staging Deployment -on: +on: push: branches: - develop-v2 @@ -15,7 +15,7 @@ env: APPDOMAIN: ${{ secrets.APPDOMAIN }} GKE_ZONE: ${{ secrets.GKE_ZONE }} GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }} - TEST_CLUSTER_NAME: ${{ secrets.TEST_CLUSTER_NAME }} + CLUSTER_NAME: ${{ secrets.CLUSTER_NAME }} GCR_NAME: ${{ secrets.GCR_NAME }} APP_REPLICA_COUNT: ${{ secrets.APP_REPLICA_COUNT }} SETTINGS_NAME: ${{ secrets.SETTINGS_NAME }} @@ -34,8 +34,8 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - id: 'auth' - uses: 'google-github-actions/auth@v0' + - id: "auth" + uses: "google-github-actions/auth@v0" with: credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} project_id: ${{ secrets.GOOGLE_CLOUD_PROJECT }} @@ -43,7 +43,7 @@ jobs: # Configure Docker to use the gcloud command-line tool as a credential # helper for authentication - run: |- - gcloud --quiet auth configure-docker + gcloud --quiet auth configure-docker - name: Build and Push Image run: |- @@ -56,10 +56,50 @@ jobs: - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e with: - cluster_name: ${{ secrets.TEST_CLUSTER_NAME }} + cluster_name: ${{ secrets.CLUSTER_NAME }} location: ${{ secrets.GKE_ZONE }} credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} - + + - name: Deploy to Google Kubernetes engine + shell: bash + run: cd deploy/ && cat deploy.sh && sh deploy.sh + + deploy_to_sil_testing: + name: Deploy sil testing server to google kubernetes engine + runs-on: ubuntu-latest + environment: + name: sil-uat + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - id: "auth" + uses: "google-github-actions/auth@v0" + with: + credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} + project_id: ${{ secrets.GOOGLE_CLOUD_PROJECT }} + + # Configure Docker to use the gcloud command-line tool as a credential + # helper for authentication + - run: |- + gcloud --quiet auth configure-docker + + - name: Build and Push Image + run: |- + docker build -t eu.gcr.io/${{ secrets.GOOGLE_CLOUD_PROJECT }}/${{ secrets.GCR_NAME }}:$GITHUB_SHA . + docker push eu.gcr.io/${{ secrets.GOOGLE_CLOUD_PROJECT }}/${{ secrets.GCR_NAME }}:$GITHUB_SHA + + - name: Install Helm + run: | + curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash + + - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e + with: + cluster_name: ${{ secrets.CLUSTER_NAME }} + location: ${{ secrets.GKE_ZONE }} + credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} + - name: Deploy to Google Kubernetes engine shell: bash - run: cd deploy/ && cat deploy.sh && sh deploy.sh \ No newline at end of file + run: cd deploy/ && cat deploy.sh && sh deploy.sh