From b2cea7be32c9eeb0964e2fefd43ee74bb456c06d Mon Sep 17 00:00:00 2001 From: Fredrik Monsen Date: Thu, 18 Apr 2024 08:05:54 +0200 Subject: [PATCH] change deploy command order --- .github/workflows/ci_pipeline.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci_pipeline.yml b/.github/workflows/ci_pipeline.yml index def05ad..8a5290a 100644 --- a/.github/workflows/ci_pipeline.yml +++ b/.github/workflows/ci_pipeline.yml @@ -82,7 +82,7 @@ jobs: file: Dockerfile deploy-to-stage: - name: Deploy to kubernetes stage environment + name: [STAGE] Deploy to kubernetes needs: build-and-publish runs-on: [self-hosted, Linux] # if: github.ref == 'refs/heads/main' @@ -107,16 +107,17 @@ jobs: with: version: 'v1.26.5' - - name: Deploy to k8s + - name: Deploy to stage cluster run: | - kubectl config set-cluster k8s --server="${{ steps.import-secrets.outputs.K8S_STAGE_SERVER }}" - kubectl config set clusters.k8s.certificate-authority-data ${{ steps.import-secrets.outputs.K8S_STAGE_NB_NO_CA }} + echo "Deploying to stage version ${{ github.ref_name }}" + sed -i "s//${{ env.APP_VERSION }}/g" k8s/stage/hugin.yml + sed -i "s//${{ steps.import-secrets.outputs.K8S_HOST_URL }}/g" k8s/stage/hugin.yml + kubectl config set-cluster stagecl --server=${{ steps.import-secrets.outputs.K8S_STAGE_SERVER }} + kubectl config set clusters.stagecl.certificate-authority-data ${{ steps.import-secrets.outputs.K8S_STAGE_NB_NO_CA }} kubectl config set-credentials ${{ steps.import-secrets.outputs.K8S_STAGE_USER }} --token=${{ steps.import-secrets.outputs.K8S_STAGE_NB_NO_TOKEN }} - kubectl config set-context hugin --cluster=k8s --user=${{ steps.import-secrets.outputs.K8S_STAGE_USER }} --namespace=tekst-stage - kubectl config use-context hugin + kubectl config set-context tekst --cluster=stagecl --user=${{ steps.import-secrets.outputs.K8S_STAGE_USER }} --namespace=tekst-stage + kubectl config use-context tekst kubectl config view kubectl version - sed -i "s//${{ env.APP_VERSION }}/g" k8s/stage/hugin.yml - sed -i "s//${{ steps.import-secrets.outputs.K8S_HOST_URL }}/g" k8s/stage/hugin.yml kubectl apply -f k8s/stage/hugin.yml - kubectl rollout restart deploy/hugin \ No newline at end of file + kubectl rollout restart deploy/bikube \ No newline at end of file