Skip to content

Commit

Permalink
fix(build): use passphrase ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
jonassimoen committed Oct 21, 2023
1 parent 7f948d5 commit 83f5ec3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ jobs:
runs-on: ubuntu-latest
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_KEY}}
SSH_PASSPHRASE: ${{secrets.SSH_KEY}}
SERVER_IP: ${{secrets.SERVER_IP}}
NODE_OPTIONS: --max-old-space-size=2048
steps:
- name: Setup SSH
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo 'echo ${{secrets.SSH_PWD}}' > ~/.ssh/passphrase && chmod 700 ~/.ssh/passphrase
echo 'echo $SSH_PASSPHRASE' > ~/.ssh/passphrase && chmod 700 ~/.ssh/passphrase
SSH_ASKPASS_REQUIRE=force SSH_ASKPASS="/root/.ssh/pass" ssh-add $SSH_PRIVATE_KEY
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm install yarn -g
Expand All @@ -30,7 +32,7 @@ jobs:
run: |
which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
eval $(ssh-agent -s)
cat ${{secrets.SSH_KEY}} | tr -d '\r' | DISPLAY=None SSH_ASKPASS=~/.ssh/passphrase ssh-add -
cat $SSH_PRIVATE_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 83f5ec3

Please sign in to comment.