ci: use base64-encoded SSH key to preserve newlines
This commit is contained in:
@@ -55,16 +55,13 @@ jobs:
|
||||
needs: build-and-push
|
||||
steps:
|
||||
- name: Deploy via SSH
|
||||
env:
|
||||
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
DEPLOY_PASSPHRASE: ${{ secrets.DEPLOY_PASSPHRASE }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
IMAGE_TAG="${{ needs.build-and-push.outputs.image_tag }}"
|
||||
|
||||
printf '%s\n' "$DEPLOY_SSH_KEY" > /tmp/deploy_key
|
||||
echo "${{ secrets.DEPLOY_SSH_KEY_B64 }}" | base64 -d > /tmp/deploy_key
|
||||
chmod 600 /tmp/deploy_key
|
||||
printf '%s\n' "$DEPLOY_PASSPHRASE" > /tmp/passphrase
|
||||
echo "${{ secrets.DEPLOY_PASSPHRASE }}" > /tmp/passphrase
|
||||
|
||||
sudo apt-get update -qq && sudo apt-get install -y -qq sshpass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user