infra/.forgejo/workflows/k8s-diff-and-deploy.yaml
Finn ff115f79aa
Some checks failed
/ build-deployer (push) Failing after 10s
/ diff-and-deploy (push) Successful in 33s
begin work on autodeployer
2024-10-29 23:16:27 -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.devhack.net/devhack/containers/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