-
-
Notifications
You must be signed in to change notification settings - Fork 22
52 lines (50 loc) · 1.23 KB
/
ci.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
48
49
50
51
52
---
name: CI
on:
push:
branches:
- main
paths:
- ".github/workflows/ci.yml"
- "deployment/*"
pull_request:
branches:
- main
paths:
- ".github/workflows/ci.yml"
- "deployment/*"
workflow_dispatch:
jobs:
k8s-test:
runs-on: ubuntu-latest
if: ${{ ! contains(github.ref, 'main') }}
steps:
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.8.0
- name: Checkout
uses: actions/checkout@v3
- name: Run K8s test
run: |
kubectl cluster-info
export NS=`cat deployment/kustomization.yml | grep namespace | awk '{ print $2 }'`
if [ -z "$NS" ]; then
export NS='nifi'
fi
kubectl create namespace $NS
kubectl apply -n $NS -k deployment/
kubectl get all -A
auto-approve:
runs-on: ubuntu-latest
needs: [k8s-test]
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Auto Approve PR
uses: actions/github-script@v6
with:
script: |
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
event: "APPROVE"
})