Skip to content

Commit

Permalink
fix(deploy): using passphrase for private ssh key
Browse files Browse the repository at this point in the history
  • Loading branch information
jonassimoen committed Oct 21, 2023
1 parent b829f93 commit 6cd3620
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
SERVER_IP: ${{secrets.SERVER_IP}}
NODE_OPTIONS: --max-old-space-size=2048
steps:
- name: Setup SSH
run: |
echo 'echo ${{secrets.SSH_PWD}}' > ~/.ssh/passphrase && chmod 700 ~/.ssh/passphrase
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm install yarn -g
Expand All @@ -25,7 +29,7 @@ jobs:
run: |
which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
eval $(ssh-agent -s)
ssh-add <(echo "$SSH_PRIVATE_KEY" )
cat ${{secrets.SSH_KEY}} | tr -d '\r' | DISPLAY=None SSH_ASKPASS=~/.ssh/passphrase ssh-add -
mkdir -p ~/.ssh
chmod 700 ~/.ssh
ssh-keyscan $SERVER_IP >> ~/.ssh/known_hosts
Expand Down

0 comments on commit 6cd3620

Please sign in to comment.