diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 428779f..c37ee2a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -51,16 +51,23 @@ jobs: run: | set -euo pipefail install -m 700 -d ~/.ssh - printf '%s\n' "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519 + # Loc ky tu CR (secret paste tu Windows/chat hay dinh CRLF lam hong key). + printf '%s\n' "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 + # Fail som neu key hong: in armor + fingerprint (khong lo secret) de doi chieu. + head -n 1 ~/.ssh/id_ed25519 + tail -n 1 ~/.ssh/id_ed25519 + ssh-keygen -lf ~/.ssh/id_ed25519 cat > ~/.ssh/config <<'EOF' Host bastion HostName 103.195.236.32 User root + IdentityFile ~/.ssh/id_ed25519 StrictHostKeyChecking accept-new Host prod HostName 100.109.54.207 User neurosus + IdentityFile ~/.ssh/id_ed25519 ProxyJump bastion StrictHostKeyChecking accept-new EOF