Adding cleanup action on delete
authorDavid Négrier <d.negrier@thecodingmachine.com>
Wed, 27 May 2020 20:20:08 +0000 (22:20 +0200)
committerDavid Négrier <d.negrier@thecodingmachine.com>
Wed, 27 May 2020 20:20:08 +0000 (22:20 +0200)
.github/workflows/cleanup.yml [new file with mode: 0644]

diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml
new file mode 100644 (file)
index 0000000..919d685
--- /dev/null
@@ -0,0 +1,24 @@
+name: Cleanup images and environments
+
+on:
+  - delete
+
+# Enables BuildKit
+env:
+  DOCKER_BUILDKIT: 1
+
+jobs:
+
+  delete_namespace:
+    runs-on: ubuntu-latest
+
+    steps:
+      # Create a slugified value of the branch
+      - uses: rlespinasse/github-slug-action@1.1.0
+
+      - name: Cleanup
+        uses: thecodingmachine/deeployer-cleanup-action@master
+        env:
+          KUBE_CONFIG_FILE: ${{ secrets.KUBE_CONFIG_FILE }}
+        with:
+          namespace: workadventure-${{ env.GITHUB_REF_SLUG }}