Use CA of k8s in Forgejo action
All checks were successful
/ blog-pim (push) Successful in 1m57s

This commit is contained in:
Pim Kunis 2024-05-01 23:03:37 +02:00
parent 614e33c583
commit df01977bba

View file

@ -9,7 +9,7 @@ jobs:
- name: Clone repository
run: git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git src
- run: ls -alh /var/run/secrets/kubernetes.io/serviceaccount
- run: nix run nixpkgs#kubectl -- config set-cluster my-cluster --server=https://kubernetes.default.svc
- run: nix run nixpkgs#kubectl -- config set-cluster my-cluster --server=https://kubernetes.default.svc --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
- run: nix run nixpkgs#kubectl -- config set-credentials my-service-account --token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
- run: nix run nixpkgs#kubectl -- config set-context my-context --cluster=my-cluster --user=my-service-account
- run: nix run nixpkgs#kubectl -- config use-context my-context