From ad62383af9041586e9cd7d2570166485a915f0fe Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Fri, 25 Oct 2024 21:07:41 -0700 Subject: [PATCH] #17 Split up SSH setup steps Better resolution for profiling the problematic "Derive host IPs" step --- .gitea/workflows/silver-flame-deploy.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/silver-flame-deploy.yaml b/.gitea/workflows/silver-flame-deploy.yaml index ad736f2e..76b26d48 100644 --- a/.gitea/workflows/silver-flame-deploy.yaml +++ b/.gitea/workflows/silver-flame-deploy.yaml @@ -29,12 +29,16 @@ jobs: extraPullNames: nix-community - name: Set up deploy-rs run: nix build -o deploy github:serokell/deploy-rs#defaultPackage.x86_64-linux - - name: Set up SSH + - name: Set up SSH key run: | echo -e "${{ secrets.RUNNER_SSH_PRIVATEKEY }}" > /tmp/key chmod 600 /tmp/key + - name: Derive host IPs + run: | nix eval --json .#deploy.nodes --apply 'builtins.attrValues' |\ jq -r '.[].hostname' | xargs echo > /tmp/hostlist + - name: Add host keys to known_hosts + run: | mkdir -p ~/.ssh && touch ~/.ssh/known_hosts && chmod 600 ~/.ssh/known_hosts for host in $(cat /tmp/hostlist); do ssh-keyscan -t ed25519 $host >> ~/.ssh/known_hosts