Skip to content

Commit b266c69

Browse files
committed
Improve: Avoid overwriting the key every time the script runs.
1 parent a8c189c commit b266c69

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ jobs:
5050
- name: Save the SSH private key to a file
5151
run: |
5252
mkdir -p ~/.ssh
53-
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
54-
chmod 600 ~/.ssh/id_rsa
53+
if [ ! -f ~/.ssh/id_rsa ]; then
54+
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
55+
chmod 600 ~/.ssh/id_rsa
56+
fi
5557
5658
- name: Add remote server to known_hosts
5759
run: |

0 commit comments

Comments
 (0)