Skip to content

Commit

Permalink
change deploy command order
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikmonsen committed Apr 18, 2024
1 parent a8dfb80 commit b2cea7b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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/<version>/${{ env.APP_VERSION }}/g" k8s/stage/hugin.yml
sed -i "s/<host_url>/${{ 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/<version>/${{ env.APP_VERSION }}/g" k8s/stage/hugin.yml
sed -i "s/<host_url>/${{ steps.import-secrets.outputs.K8S_HOST_URL }}/g" k8s/stage/hugin.yml
kubectl apply -f k8s/stage/hugin.yml
kubectl rollout restart deploy/hugin
kubectl rollout restart deploy/bikube

0 comments on commit b2cea7b

Please sign in to comment.