-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 1.22 KB
/
cleanup.yaml
File metadata and controls
39 lines (36 loc) · 1.22 KB
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
---
name: "Cleanup Dev Resources"
on:
pull_request_target:
types:
- closed
jobs:
cleanup:
if: ${{ github.event.pull_request.merged == true }}
name: "Cleanup Dev Kubernetes Resources"
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
environment: development
steps:
- name: Set _REPONAME environment variable
run: echo "_REPONAME=${GITHUB_REPOSITORY#"broadinstitute/"}" >> $GITHUB_ENV
- uses: "actions/checkout@v6"
- uses: "google-github-actions/auth@v3"
with:
workload_identity_provider: ${{ vars._WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars._SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v3"
with:
version: ">= 506.0.0"
- id: "get-credentials"
uses: "google-github-actions/get-gke-credentials@v3"
with:
cluster_name: "gke-autopilot-01-prod"
location: ${{ vars._LOCATION }}
project_id: ${{ vars._GKE_PROJECT }}
- id: "scale-down-pods"
name: "Scale Down Dev Deployment"
run: kubectl scale deployment ${{ vars._APP }} -n ${{ vars._NAMESPACE }} --replicas=0