Use hostname with kubectl in Forgejo action
Some checks failed
/ blog-pim (push) Failing after 2m8s

This commit is contained in:
Pim Kunis 2024-05-02 22:02:40 +02:00
parent 2e934940e0
commit 48bcb0ed6f

View file

@ -9,16 +9,15 @@ jobs:
- name: Clone repository - name: Clone repository
run: git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git src run: git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git src
- run: "curl --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt -H \"Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\" https://kubernetes.default.svc/api/v1/namespaces/default/pods" - run: "curl --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt -H \"Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\" https://kubernetes.default.svc/api/v1/namespaces/default/pods"
- 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-cluster my-cluster --server=https://jefke.dmz:6443 --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-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 set-context my-context --cluster=my-cluster --user=my-service-account
- run: nix run nixpkgs#kubectl -- config use-context my-context - run: nix run nixpkgs#kubectl -- config use-context my-context
# - run: nix run nixpkgs#kubectl -- get pods - run: nix run nixpkgs#kubectl -- get pods
- run: | # - run: |
mkdir -p ~/.config/sops/age # mkdir -p ~/.config/sops/age
echo -n "${{ secrets.AGE_SECRET_KEY }}" > ~/.config/sops/age/keys.txt # echo -n "${{ secrets.AGE_SECRET_KEY }}" > ~/.config/sops/age/keys.txt
# - run: nix run nixpkgs#sops -- --decrypt src/secrets/sops.yaml | grep "paperless-ngx:" # - run: |
- run: | # cd src
cd src # nix build .#kubenix.x86_64-linux
nix build .#kubenix.x86_64-linux # bash result/bin/kubenix apply --all
bash result/bin/kubenix apply --all