Restart Deployment #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Restart Deployment | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ['Publish on GitHub Container Registry'] | |
types: [completed] | |
jobs: | |
restart_deployment: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Configure Kubectl | |
env: | |
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | |
run: | | |
mkdir -p $HOME/.kube | |
KUBE_TOKEN=$(echo $KUBE_CONFIG | jq -r .KUBE_TOKEN) | |
KUBE_CERTIFICATE=$(echo $KUBE_CONFIG | jq -r .KUBE_CERTIFICATE) | |
KUBE_SERVER=$(echo $KUBE_CONFIG | jq -r .KUBE_SERVER) | |
echo "$KUBE_CERTIFICATE" | base64 --decode > $HOME/.kube/ca.crt | |
kubectl config set-cluster argocluster-doks --server="$KUBE_SERVER" --certificate-authority=$HOME/.kube/ca.crt | |
kubectl config set-credentials github-actions-deployer --token="$KUBE_TOKEN" | |
kubectl config set-context argo --cluster=argocluster-doks --user=github-actions-deployer --namespace=subscriptions-ri | |
kubectl config use-context argo | |
- name: Restart Deployment | |
run: | | |
kubectl -n subscriptions-ri rollout restart deployment |