fix: use key directly since secret is now working
Deploy to Dev / deploy-dev (push) Failing after 2s
Details
Deploy to Dev / deploy-dev (push) Failing after 2s
Details
This commit is contained in:
parent
b2ec252ae0
commit
0ba0be36e6
|
|
@ -9,38 +9,12 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup SSH Key
|
|
||||||
run: |
|
|
||||||
echo "=== Checking SSH_PRIVATE_KEY secret ==="
|
|
||||||
if [ -z "$SSH_PRIVATE_KEY" ]; then
|
|
||||||
echo "ERROR: SSH_PRIVATE_KEY environment variable is empty!"
|
|
||||||
echo "Checking secrets directly..."
|
|
||||||
if [ -z "${{ secrets.SSH_PRIVATE_KEY }}" ]; then
|
|
||||||
echo "ERROR: secrets.SSH_PRIVATE_KEY is also empty!"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "secrets.SSH_PRIVATE_KEY exists, length: ${#{{ secrets.SSH_PRIVATE_KEY }}}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "SSH_PRIVATE_KEY env var exists, length: ${#SSH_PRIVATE_KEY}"
|
|
||||||
fi
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_key
|
|
||||||
chmod 600 ~/.ssh/deploy_key
|
|
||||||
echo "SSH key file created. Checking format..."
|
|
||||||
head -1 ~/.ssh/deploy_key
|
|
||||||
tail -1 ~/.ssh/deploy_key
|
|
||||||
wc -l ~/.ssh/deploy_key
|
|
||||||
ssh-keyscan -H ${{ secrets.DEV_HOST }} >> ~/.ssh/known_hosts 2>/dev/null || true
|
|
||||||
env:
|
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
||||||
|
|
||||||
- name: Deploy to Dev Server
|
- name: Deploy to Dev Server
|
||||||
uses: appleboy/ssh-action@v1.0.0
|
uses: appleboy/ssh-action@v1.0.0
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.DEV_HOST }}
|
host: ${{ secrets.DEV_HOST }}
|
||||||
username: ${{ secrets.DEV_USER }}
|
username: ${{ secrets.DEV_USER }}
|
||||||
key_path: ~/.ssh/deploy_key
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
use_insecure_cipher: true
|
use_insecure_cipher: true
|
||||||
debug: true
|
debug: true
|
||||||
script: |
|
script: |
|
||||||
|
|
@ -67,7 +41,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.DEV_HOST }}
|
host: ${{ secrets.DEV_HOST }}
|
||||||
username: ${{ secrets.DEV_USER }}
|
username: ${{ secrets.DEV_USER }}
|
||||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
key_path: ~/.ssh/deploy_key
|
||||||
use_insecure_cipher: true
|
use_insecure_cipher: true
|
||||||
debug: true
|
debug: true
|
||||||
script: |
|
script: |
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue