From b702d212e63ef0df6ca3d539c774fadaa6979eb9 Mon Sep 17 00:00:00 2001 From: Nick Clyde Date: Wed, 4 Sep 2024 09:11:51 -0700 Subject: [PATCH] Write SSH key to file --- .github/workflows/deployment.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 9df2fcb..d12279a 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -50,10 +50,13 @@ jobs: AZURE_VM_IP: ${{ secrets.AZURE_VM_IP }} AZURE_VM_SSH_KEY: ${{ secrets.AZURE_VM_SSH_KEY }} run: | + install -m 600 -D /dev/null ~/.ssh/phinvads-go + echo "${{ secrets.AZURE_VM_SSH_KEY }}" > ~/.ssh/phinvads-go + ssh-keyscan -H $AZURE_VM_IP > ~/.ssh/known_hosts go install github.com/a-h/templ/cmd/templ@latest templ generate go build -o phinvads-go ./cmd/phinvads-go - scp -i <(echo "$AZURE_VM_SSH_KEY") ./phinvads-go azureuser@${AZURE_VM_IP}:/home/azureuser/phinvads-go + scp -i ~/.ssh/phinvads-go ./phinvads-go azureuser@${AZURE_VM_IP}:/home/azureuser/phinvads-go - name: Disallow GitHub Runner IP run: |