Skip to content

Commit 6844f58

Browse files
committed
Add verbosity, if expose key will rotate
1 parent d19a653 commit 6844f58

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/deployment.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ jobs:
6363
SSH_WEB_PATH: ${{ secrets.SSH_WEB_PATH }}
6464
BRANCH_NAME: ${{ github.ref_name }}
6565
run: |
66+
#!/usr/bin/env bash
67+
68+
set -ex -o pipefail
69+
6670
# Save the private key for SSH
67-
mkdir -p ~/.ssh
71+
mkdir -pv ~/.ssh
6872
echo "${SSH_KEY}" > "~/.ssh/id_${SSH_USER}"
69-
chmod 600 "~/.ssh/id_${SSH_USER}"
73+
chmod -v 400 "~/.ssh/id_${SSH_USER}"
7074
7175
# Copy the artifact to the Remote
7276
scp -i "~/.ssh/id_${SSH_USER}" -P "${SSH_PORT}" project.zip "${SSH_USER}@${SSH_HOST}:${SSH_WEB_PATH}/${BRANCH_NAME}"
@@ -78,3 +82,6 @@ jobs:
7882
unzip ./project.zip
7983
rm ./project.zip
8084
EOF
85+
86+
# Cleanup the secret
87+
rm -rfv "~/.ssh/id_${SSH_USER}" "~/.ssh/id_${SSH_USER}.pub"

0 commit comments

Comments
 (0)