From cb7dd93b4e7c71ac5c77c9c04f8f8c39a096e968 Mon Sep 17 00:00:00 2001 From: Seyi <112594967+seyi007i@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:49:16 +0100 Subject: [PATCH] Update solar-system.yml --- .github/workflows/solar-system.yml | 56 +++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/.github/workflows/solar-system.yml b/.github/workflows/solar-system.yml index bfbf3492..3c297d64 100644 --- a/.github/workflows/solar-system.yml +++ b/.github/workflows/solar-system.yml @@ -58,20 +58,66 @@ jobs: push: true tags: 'docker.io/seyiogunniran/solar-system:${{ github.sha }}' #tags: 'ghcr.io/${{ github.repository_owner }}/solar-system:${{ github.sha }}' - + dev-deploy: needs: docker runs-on: ubuntu-latest environment: name: development + steps: - - uses: actions/checkout@v4 - - uses: azure/setup-kubectl@v3 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Install kubectl Cli + uses: azure/setup-kubectl@v3 with: version: v1.26.0 - - uses: azure/k8s-set-context@v3 + + - name: Set kubconfig file + uses: azure/k8s-set-context@v3 with: method: kubeconfig kubeconfig: '${{ secrets.KUBECONFIG }}' - - run: kubectl version --short -o yaml + - name: Fetch kubernetes cluster details + run: | + kubectl version --short -o yaml + echo -------------------------- + kubectl get nodes + + - name: Save AWS Ingress Controller IP as a GITHUB Env variable + run: | + kubectl get ingress -n game-2048 + + - name: Replace Token in Manifest files + uses: cschleiden/replace-tokens@v1 + with: + tokenPrefix: '_{_' + tokenSuffix: '_}_' + files: '["kubernetes/development/*.yaml"]' + env: + NAMESPACE: ${{ vars.NAMESPACE }} + REPLICAS: ${{ vars.REPLICAS }} + IMAGE: docker.io/seyiogunniran/solar-systems:${{ github.sha }} + + - name: Check files list + run: cat kubernetes/development/*.yaml + + - name: Create MongoDB Seceret + run: | + kubectl -n ${{ vars.NAMESPACE }} create secret generic mongo-db-creds + ---literal=MONGO_URI=${{ env.MONGO_URI }} \ + ---literal=MONGO_USERNAME=${{ env.MONGO_USERNAME }} \ + ---literal=MONGO_PASSWORD=${{ secrets.MONGO_PASSWORD }} \ + ---save-config \ + ---dry-run=client \ + -o yaml | kubectl apply -f - + + - name: Deploy kubernetes + run: | + kubectl apply -f kubernetes/development + + + +