File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright 2020 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ name : " Clean up deployment"
16+ on :
17+ pull_request :
18+ # run on pull requests targeting main
19+ branches :
20+ - main
21+ types : closed
22+ paths-ignore :
23+ - ' **/README.md'
24+ - ' kustomize/**'
25+ - ' .github/workflows/kustomize-build-ci.yaml'
26+ - ' terraform/**'
27+ - ' .github/workflows/terraform-validate-ci.yaml'
28+ jobs :
29+ cleanup-namespace :
30+ runs-on : [self-hosted, is-enabled]
31+ steps :
32+ - name : Delete PR namespace in staging cluster
33+ if : ${{ always() }}
34+ timeout-minutes : 20
35+ run : |
36+ gcloud container clusters get-credentials $PR_CLUSTER \
37+ --region $REGION --project $PROJECT_ID
38+ NAMESPACE="pr${PR_NUMBER}"
39+ kubectl delete namespace $NAMESPACE
40+ env :
41+ PROJECT_ID : " online-boutique-ci"
42+ PR_CLUSTER : " prs-gke-cluster"
43+ REGION : " us-central1"
44+ PR_NUMBER : ${{ github.event.number }}
You can’t perform that action at this time.
0 commit comments