-
Notifications
You must be signed in to change notification settings - Fork 10
47 lines (43 loc) · 1.68 KB
/
te-stop_review.yml
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
name: (TET) Stop Review
on:
pull_request:
types: [closed]
paths:
- 'backend/tet/**'
- 'frontend/tet/**'
- 'frontend/shared/**'
- 'frontend/*'
- '.github/workflows/te-stop_review.yml'
workflow_dispatch:
inputs:
head_ref:
description: "Branch where review environment was created from (as in GitHub). Has to be given as the branch is probably removed and no longer available in the branch list. Can be empty if environment deployed manually"
pr_number:
description: "Own or pull request number of the environment creator"
env:
KUBECONFIG_RAW: ${{ secrets.KUBECONFIG_RAW }}
jobs:
stop_review:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
name: Stop Review
steps:
- uses: andersinno/kolga-setup-action@v2
with:
head_ref: ${{ github.event.inputs.head_ref }}
pr_number: ${{ github.event.inputs.pr_number }}
- name: Remove Review-Services
uses: City-of-Helsinki/review-services-action@main
with:
database: ${{ github.event.repository.name }}-te-bknd-${{ github.event.pull_request.number }}
namespace: ${{ env.K8S_NAMESPACE }}
action: remove
db_user: ${{ secrets.K8S_SECRET_DATABASE_ADMIN_USERNAME_REVIEW }}
db_password: ${{ secrets.K8S_SECRET_DATABASE_ADMIN_PASSWORD_REVIEW }}
db_host: ${{ secrets.K8S_SECRET_DATABASE_HOST_REVIEW }}
db_port: ${{ secrets.K8S_SECRET_DATABASE_PORT_REVIEW }}
kubeconfig: ${{ secrets.KUBECONFIG_RAW }}
- name: Stop Review
uses: andersinno/kolga-review-cleanup-action@v2
with:
namespace: ${{ env.K8S_NAMESPACE }}