From 614e33c58341f124bd68d889ed5805710db2eb67 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Wed, 1 May 2024 23:00:13 +0200 Subject: [PATCH] Try to use service account token inside Forgejo action --- .forgejo/workflows/deploy.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 8c2534f..4540bf6 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -4,8 +4,14 @@ jobs: runs-on: docker container: image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962 - options: "-v /var/run/secrets/kubernetes.io/serviceaccount:/testje" + options: "-v /var/run/secrets/kubernetes.io/serviceaccount:/var/run/secrets/kubernetes.io/serviceaccount" steps: - name: Clone repository run: git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git src - - run: ls -alh /testje + - 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-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 + - run: nix run nixpkgs#kubectl -- get pods +