name: Apply Kuberentes Configs on: [push, workflow_dispatch] jobs: update-repo: runs-on: [home-server] steps: - name: checkout repo working-directory: /home/github/infrastructure run: | if [ -d "infrastructure" ]; then cd infrastructure echo "Infrastructure folder exists. Resetting to the most recent commit." git reset --hard HEAD git pull https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} $(git rev-parse --abbrev-ref HEAD) else git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git fi update-infrastructure: runs-on: [home-server] needs: update-repo steps: - name: update home server containers env: KUBECONFIG: /home/github/.kube/config MY_GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} HOMEASSISTANT_TOKEN: ${{ secrets.HOMEASSISTANT_TOKEN }} GRAFANA_PASSWORD: ${{ secrets.GRAFANA_PASSWORD }} CLOUDFLARE_CONFIG: ${{ secrets.CLOUDFLARE_CONFIG }} COPILOT_TOKEN: ${{ secrets.COPILOT_TOKEN }} working-directory: /home/github/infrastructure/infrastructure run: | helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm repo update helm install ingress-nginx ingress-nginx/ingress-nginx \ --namespace ingress-nginx \ --create-namespace \ --set controller.kind=DaemonSet \ --set controller.hostNetwork=true \ --set controller.service.type=NodePort \ --set controller.allowSnippetAnnotations=true \ --set controller.metrics.enabled=false # kubectl apply -f kubernetes/ingress kubectl apply -f kubernetes/proxy-ingress kubectl annotate ingressclass nginx \ ingressclass.kubernetes.io/is-default-class="true" --overwrite