From 153c1def692ca7743e3e7fd9305a87ad5ed05cb4 Mon Sep 17 00:00:00 2001 From: Jay Malhotra <5047192+SapiensAnatis@users.noreply.github.com> Date: Sun, 16 Jul 2023 15:49:57 +0100 Subject: [PATCH] Update CI deployment environments (#308) Deploy the state manager and API server into different GitHub environments, and have them inherit the kubernetes variables from there. --- .github/workflows/deploy.yaml | 14 +++++--------- .github/workflows/publish-push.yaml | 12 ++---------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index eb6f50c07..12af9eac0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -3,20 +3,16 @@ name: deploy on: workflow_call: inputs: - deployment: + github-environment: type: string required: true - description: "Kubernetes deployment name" - namespace: - type: string - required: true - description: "Kubernetes namespace" + description: "GitHub environment name" jobs: deploy: runs-on: ubuntu-latest environment: - name: Production + name: ${{ inputs.github-environment }} url: https://dawnshard.co.uk steps: - name: ssh and restart pods @@ -27,5 +23,5 @@ jobs: key: ${{ secrets.SSH_KEY }} script_stop: true script: | - kubectl rollout restart deployment/${{ inputs.deployment }} -n ${{ inputs.namespace }} - kubectl rollout status deployment/${{ inputs.deployment }} -n ${{ inputs.namespace }} + kubectl rollout restart deployment/${{ vars.K8S_DEPLOYMENT }} -n ${{ vars.K8S_NAMESPACE }} + kubectl rollout status deployment/${{ vars.K8S_DEPLOYMENT }} -n ${{ vars.K8S_NAMESPACE }} diff --git a/.github/workflows/publish-push.yaml b/.github/workflows/publish-push.yaml index 9f3d73ace..6d92ec8b7 100644 --- a/.github/workflows/publish-push.yaml +++ b/.github/workflows/publish-push.yaml @@ -31,17 +31,9 @@ jobs: deploy: strategy: matrix: - args: - [ - { - deployment: "photonstatemanager", - namespace: "photonstatemanager", - }, - { deployment: "dragalia-api-dawnshard", namespace: "dragalia-api" }, - ] + github-environment: ["PhotonStateManager", "Dawnshard"] needs: publish uses: ./.github/workflows/deploy.yaml with: - deployment: ${{ matrix.args.deployment }} - namespace: ${{ matrix.args.namespace }} + github-environment: ${{ matrix.github-environment }} secrets: inherit