From e13e3410f65a3ed0fe60fec7bf71fabc2515f836 Mon Sep 17 00:00:00 2001 From: mabdulmoghni Date: Sat, 23 Mar 2024 03:17:12 +0200 Subject: [PATCH 1/2] update/add prod ci jobs --- .github/workflows/publish-cloud-dashboard.yml | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/publish-cloud-dashboard.yml b/.github/workflows/publish-cloud-dashboard.yml index 1367bd1e..a52a5afa 100644 --- a/.github/workflows/publish-cloud-dashboard.yml +++ b/.github/workflows/publish-cloud-dashboard.yml @@ -173,48 +173,48 @@ jobs: manifests: | staging-managed-dashboard.yaml - # deploy_managed-dashboard_k8s-managed-production: - # runs-on: ubuntu-latest - # needs: [build] - # if: ${{ (github.event_name == 'push') && (github.ref == 'refs/heads/main') }} - # steps: - # - uses: actions/checkout@v3 - - # - name: Add SHORT_SHA env property with commit short sha - # run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV - - # - name: Kustomize and validate k8s-manifests - # uses: yokawasa/action-setup-kube-tools@v0.9.2 - # with: - # setup-tools: | - # kubeconform - # kustomize - # kubeconform: '0.5.0' - # kustomize: '4.5.7' - # - run: | - # kustomize build k8s-manifests/environments/production | kubeconform -verbose - # kustomize build k8s-manifests/environments/production > ./prod-managed-dashboard.yaml - - # - name: update managed-dashboard with secrets values - production - # env: - # NEXT_PUBLIC_WS_API_URL: "${{ secrets.PROD_NEXT_PUBLIC_WS_API_URL }}" - # NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: "${{ secrets.PROD_NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY }}" - # API_URL: "${{ secrets.PROD_API_URL }}" - # run: | - # envsubst < ./prod-managed-dashboard.yaml | tee prod-managed-dashboard.yaml - - # - name: K8s-set-context to DO managed-production cluster - # uses: azure/k8s-set-context@v1 - # with: - # method: kubeconfig - # kubeconfig: ${{ secrets.KUBECONFIG_DO_MANAGED_PRODUCTION }} - - # - name: Deploy to the DO managed-production cluster - # uses: azure/k8s-deploy@v1 - # with: - # namespace: kotal - # manifests: | - # prod-managed-dashboard.yaml + deploy_managed-dashboard_k8s-managed-production: + runs-on: ubuntu-latest + needs: [build] + if: ${{ (github.event_name == 'push') && (github.ref == 'refs/heads/main') }} + steps: + - uses: actions/checkout@v3 + + - name: Add SHORT_SHA env property with commit short sha + run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV + + - name: Kustomize and validate k8s-manifests + uses: yokawasa/action-setup-kube-tools@v0.9.2 + with: + setup-tools: | + kubeconform + kustomize + kubeconform: '0.5.0' + kustomize: '4.5.7' + - run: | + kustomize build k8s-manifests/environments/production | kubeconform -verbose + kustomize build k8s-manifests/environments/production > ./prod-managed-dashboard.yaml + + - name: update managed-dashboard with secrets values - production + env: + NEXT_PUBLIC_WS_API_URL: "${{ secrets.PROD_NEXT_PUBLIC_WS_API_URL }}" + NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: "${{ secrets.PROD_NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY }}" + API_URL: "${{ secrets.PROD_API_URL }}" + run: | + envsubst < ./prod-managed-dashboard.yaml | tee prod-managed-dashboard.yaml + + - name: K8s-set-context to DO managed-production cluster + uses: azure/k8s-set-context@v1 + with: + method: kubeconfig + kubeconfig: ${{ secrets.KUBECONFIG_DO_MANAGED_PRODUCTION }} + + - name: Deploy to the DO managed-production cluster + uses: azure/k8s-deploy@v1 + with: + namespace: kotal + manifests: | + prod-managed-dashboard.yaml update_dashboard_on-testing-k8s-clusters: From 274ce1462f01a168d2a30112a5787c1fd06d9a94 Mon Sep 17 00:00:00 2001 From: mabdulmoghni Date: Mon, 1 Apr 2024 02:39:48 +0200 Subject: [PATCH 2/2] remove DO testing CI jobs --- .github/workflows/publish-cloud-dashboard.yml | 48 +------------------ 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/.github/workflows/publish-cloud-dashboard.yml b/.github/workflows/publish-cloud-dashboard.yml index a52a5afa..87bc0fdf 100644 --- a/.github/workflows/publish-cloud-dashboard.yml +++ b/.github/workflows/publish-cloud-dashboard.yml @@ -214,50 +214,4 @@ jobs: with: namespace: kotal manifests: | - prod-managed-dashboard.yaml - - - update_dashboard_on-testing-k8s-clusters: - runs-on: ubuntu-latest - needs: [build] - if: github.event_name == 'push' - - steps: - - uses: actions/checkout@v3 - - - name: Add SHORT_SHA env property with commit short sha - run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV - - - name: Get Latest core-api ImageTag - id: core-api_latest_tag - uses: luoqiz/docker-images-latest-version@master - with: - image: kotalco/core-api - - - name: Checkout kotal-helm-chart Repo - uses: actions/checkout@v3 - with: - repository: kotalco/kotal-helm-chart - path: kotal-helm-chart - - - name: Set up Helm - uses: azure/setup-helm@v3 - with: - version: v3.10.0 - - - name: Add helm dependencies repositories - run: | - for dir in $(ls -d kotal-helm-chart/charts/*/); do - helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done - done - helm dependency update kotal-helm-chart/charts/kotal - - - name: K8s-set-context to DO testing cluster - uses: azure/k8s-set-context@v1 - with: - method: kubeconfig - kubeconfig: ${{ secrets.KUBECONFIG_DO_TESTING }} - - - name: Testing and Update Kotal-Helm-Chart in DO with kotal dashboard new image [kotal.cloud] - run: | - helm upgrade kotal kotal-helm-chart/charts/kotal --install --wait --namespace=kotal --create-namespace --set-string "api.tag=${{ steps.core-api_latest_tag.outputs.version }}" --set-string "dashboard.tag=${SHORT_SHA}" --set "staging=true" --set=app.name=kotal --reuse-values --atomic \ No newline at end of file + prod-managed-dashboard.yaml \ No newline at end of file