always remove the SSH key after a deploy

The clean up step was skipped whenever a transfer failed, leaving the
deploy key on the runner. Run it even when an earlier step fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adamandClaude Opus 5.5 committed 2026-09-29 18:21:50 +00:00
1 parent 45de1fd982
commit eccee4d3f1
1 file changed
+1
+1
View File
@@ -31,4 +31,5 @@ jobs:
scp -i ~/.ssh/id_rsa www/html/wordle/* ${{ vars.REMOTE_USER }}@${{ vars.REMOTE_SERVER }}:/var/www/html/wordle/ scp -i ~/.ssh/id_rsa www/html/wordle/* ${{ vars.REMOTE_USER }}@${{ vars.REMOTE_SERVER }}:/var/www/html/wordle/
- name: Clean up SSH key - name: Clean up SSH key
if: always() # remove the key even if a transfer failed
run: rm -rf ~/.ssh run: rm -rf ~/.ssh