Deploy #53
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: Deploy | |
on: | |
workflow_run: | |
workflows: ["Docker CI"] | |
branches: [development] | |
types: | |
- completed | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
# Auto-deploys the frontend to a online development environment | |
steps: | |
- name: Add helm repository to helm | |
run: helm repo add kiss-frontend https://raw.githubusercontent.com/Klantinteractie-Servicesysteem/KISS-frontend/development/helm | |
- name: Set kubeconfig | |
id: kubeconfig | |
run: | | |
if [ "${{ secrets.KISS_DEV_KUBECONFIG }}" != "" ]; then | |
printf "${{ secrets.KISS_DEV_KUBECONFIG }}" > kubeconfig.yaml | |
echo "##[set-output name=success]true" | |
else | |
echo "##[set-output name=success]false" | |
fi | |
# Auto deploys the frontend to the development environment | |
- name: Upgrade helm installation | |
if: steps.kubeconfig.outputs.success == 'true' && success() | |
run: helm upgrade --install kiss-frontend kiss-frontend/kiss-frontend --reuse-values --kubeconfig="kubeconfig.yaml" --namespace=dev-frontend --description https://raw.githubusercontent.com/Klantinteractie-Servicesysteem/KISS-frontend/development/helm | |
- name: Rollout new containers | |
if: steps.kubeconfig.outputs.success == 'true' && success() | |
run: kubectl rollout restart deployment/kiss-frontend --kubeconfig="kubeconfig.yaml" --namespace=dev-frontend | |
- name: Cleanup | |
run: | | |
helm repo remove kiss-frontend | |
rm -rf ~/.helm/cache/archive/* | |
rm -rf ~/.helm/repository/cache/* |