-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (27 loc) · 970 Bytes
/
clean.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
---
name: Clean Deployment
on: delete
permissions:
contents: read
jobs:
create_branch_identifier:
uses: hpi-schul-cloud/dof_app_deploy/.github/workflows/branch-to-namespace.yml@main
with:
branch: devops-${{ github.event.ref }}
clean:
runs-on: ubuntu-latest
needs:
- create_branch_identifier
steps:
- run: |
mkdir files
echo "${{ secrets.DEV_KUBE_CONFIG_DBC }}" > files/config_dbc
- name: delete custom resources and namespaces
run: |
branch_identifier='${{ needs.create_branch_identifier.outputs.id_branch }}'
kubectl --kubeconfig=files/config_dbc --namespace $branch_identifier delete --ignore-not-found=true --all=true OnePasswordItem
kubectl --kubeconfig=files/config_dbc delete --ignore-not-found=true ns $branch_identifier
- name: remove kubeconfig
if: ${{ always() }}
run: |
rm -rf files