infra/.forgejo/workflows/k8s-diff-and-deploy.yaml
Finn d22e1e81b1
Some checks failed
/ diff-and-deploy (push) Failing after 41s
Activate auto-deploy
2024-10-29 23:46:54 -07:00

37 lines
1.1 KiB
YAML

on:
push:
paths:
- k8s/**
- .forgejo/workflows/k8s-diff-and-deploy.yaml
jobs:
diff-and-deploy:
runs-on: ubuntu-latest
container:
image: git.janky.solutions/jankysolutions/infra/deployer:latest
steps:
- uses: actions/checkout@v4
- name: kubectl diff and deploy
run: |
set -euo pipefail
echo "${{ secrets.KUBERNETES_CLIENT_CONFIG }}" > ~/.kube/config
for component in k8s/*; do
if [ ! -d "${component}" ]; then
continue
fi
touch "${component}/secrets.yaml"
echo "👀 $ kubectl diff -k ${component}"
kubectl diff -k "${component}" || echo
if [[ "${GITHUB_REF_NAME}" == "main" ]]; then
echo "🚀 $ kubectl apply -k ${component}"
if [[ "${component}" == "k8s/operators" ]]; then
kubectl apply -k "${component}" --server-side
else
kubectl apply -k "${component}"
fi
echo
fi
done