-
Notifications
You must be signed in to change notification settings - Fork 297
40 lines (33 loc) · 1.15 KB
/
helm_pr_deployment_delete.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Cleanup PR Deployment from Kubernetes
on:
pull_request:
types: [closed]
jobs:
destroy:
if: ${{ github.event.pull_request.head.repo.full_name == 'ls1intum/Artemis' && contains(github.event.pull_request.labels.*.name, 'deploy:k8s') }}
runs-on: ubuntu-latest
environment:
name: k8s
url: https://pr${{ github.event.pull_request.number }}.artemis-k8s.ase.cit.tum.de
concurrency:
group: k8s-pr${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- name: Setup Helm
uses: azure/setup-helm@v3
with:
version: v3.15.0
- name: Setup Kubectl
uses: azure/setup-kubectl@v3
with:
version: v1.30.1
- name: Authenticate to Kubernetes cluster
run: |
mkdir -p $HOME/.kube
echo "${{ secrets.KUBECONFIG }}" > "$HOME/.kube/config"
- name: Delete Helm release
run: |
helm uninstall artemis --namespace artemis-pr${{ github.event.pull_request.number }}
- name: Delete Kubernetes namespace
run: |
kubectl delete namespace artemis-pr${{ github.event.pull_request.number }}