-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (69 loc) · 2.29 KB
/
helm-gke-destroy.yaml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Helm GKE Destroy
# Reusable workflow for destroying a Helm chart on GKE Kubernetes
on:
workflow_call:
inputs:
release-name:
description: "Helm release name"
required: true
type: string
namespace:
description: "K8s namespace to destroy in"
required: true
type: string
gcloud-sdk-version:
description: "GCloud SDK version"
default: "376.0.0"
required: false
type: string
kubectl-version:
description: "Kubectl version"
default: "v1.23.0"
required: false
type: string
helm-version:
description: "Helm version"
default: "v3.8.1"
required: false
type: string
secrets:
gke-service-account:
description: "GKE service account key for authentication"
required: true
gke-project:
description: "GKE project id for authentication"
required: true
gke-region:
description: "GKE region for authentication"
required: true
gke-cluster:
description: "GKE cluster for authentication"
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-helm-gke-destroy
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }}
jobs:
destroy:
name: Destroy
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: bakdata/ci-templates/actions/[email protected]
- name: Setup credentials
uses: bakdata/ci-templates/actions/[email protected]
with:
gke-service-account: ${{ secrets.gke-service-account }}
gke-project: ${{ secrets.gke-project }}
gke-region: ${{ secrets.gke-region }}
gke-cluster: ${{ secrets.gke-cluster }}
gcloud-sdk-version: ${{ inputs.gcloud-sdk-version }}
- name: Setup environment
uses: bakdata/ci-templates/actions/[email protected]
with:
kubectl-version: ${{ inputs.kubectl-version }}
helm-version: ${{ inputs.helm-version }}
- name: Destroy Helm chart
uses: bakdata/ci-templates/actions/[email protected]
with:
release-name: ${{ inputs.release-name }}
namespace: ${{ inputs.namespace }}