-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (30 loc) · 904 Bytes
/
Copy pathdestruction.yaml
File metadata and controls
34 lines (30 loc) · 904 Bytes
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
---
name: Destruction
on: workflow_dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
destruction:
name: Destruction
runs-on: ubuntu-latest
env:
PROJECT: githubcontrib
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
- name: Install kubectl
uses: azure/setup-kubectl@v4.0.0
- name: Configure kubectl
run: |
mkdir ~/.kube
echo "$KUBECONFIG" > ~/.kube/config
env:
KUBECONFIG: ${{ secrets.KUBECONFIG }} # Done as a variable because it doesn't work in place.
- name: Install doctl
uses: digitalocean/action-doctl@v2.5.1
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Destroy
run: |
kubectl delete -f deployment --ignore-not-found
kubectl delete secret "$PROJECT" --ignore-not-found