Skip to content

Commit

Permalink
Update CI deployment environments (#308)
Browse files Browse the repository at this point in the history
Deploy the state manager and API server into different GitHub
environments, and have them inherit the kubernetes variables from there.
  • Loading branch information
SapiensAnatis authored Jul 16, 2023
1 parent 877f2f8 commit 153c1de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
12 changes: 2 additions & 10 deletions .github/workflows/publish-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 153c1de

Please sign in to comment.