This repository was archived by the owner on Jan 31, 2025. It is now read-only.
Clean 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: 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 |