We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d19a653 commit 6844f58Copy full SHA for 6844f58
.github/workflows/deployment.yml
@@ -63,10 +63,14 @@ jobs:
63
SSH_WEB_PATH: ${{ secrets.SSH_WEB_PATH }}
64
BRANCH_NAME: ${{ github.ref_name }}
65
run: |
66
+ #!/usr/bin/env bash
67
+
68
+ set -ex -o pipefail
69
70
# Save the private key for SSH
- mkdir -p ~/.ssh
71
+ mkdir -pv ~/.ssh
72
echo "${SSH_KEY}" > "~/.ssh/id_${SSH_USER}"
- chmod 600 "~/.ssh/id_${SSH_USER}"
73
+ chmod -v 400 "~/.ssh/id_${SSH_USER}"
74
75
# Copy the artifact to the Remote
76
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:
78
82
unzip ./project.zip
79
83
rm ./project.zip
80
84
EOF
85
86
+ # Cleanup the secret
87
+ rm -rfv "~/.ssh/id_${SSH_USER}" "~/.ssh/id_${SSH_USER}.pub"
0 commit comments