Skip to content

Clean Deployment

Clean Deployment #10

Workflow file for this run

---
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