34 lines
848 B
YAML
34 lines
848 B
YAML
name: Deploy alert rules
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'rules/**'
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: alpine
|
|
steps:
|
|
- name: Install tools
|
|
run: |
|
|
apk add --no-cache curl bash git openssh-client openssl nodejs
|
|
curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
|
chmod +x kubectl && mv kubectl /usr/local/bin/
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Configure kubeconfig
|
|
run: |
|
|
mkdir -p $HOME/.kube
|
|
echo "${{ secrets.KUBECONFIG }}" | base64 -d > $HOME/.kube/config
|
|
chmod 600 $HOME/.kube/config
|
|
|
|
- name: Deploy rules
|
|
run: kubectl apply -f rules/ -n monitoring
|
|
|
|
- name: Verify
|
|
run: |
|
|
sleep 10
|
|
kubectl get prometheusrule -n monitoring
|