Correct key usage back to normal
This commit is contained in:
parent
47bcd0aa5f
commit
2075c252f6
1 changed files with 1 additions and 14 deletions
15
.github/workflows/build-and-deploy.yml
vendored
15
.github/workflows/build-and-deploy.yml
vendored
|
|
@ -53,25 +53,12 @@ jobs:
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Prepare SSH key
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
chmod 700 ~/.ssh
|
|
||||||
# Write private key
|
|
||||||
printf "%s" "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
|
||||||
chmod 600 ~/.ssh/id_rsa
|
|
||||||
# Pre-populate known_hosts to avoid interactive prompt
|
|
||||||
ssh-keyscan -H "${{ secrets.SERVER_HOST }}" >> ~/.ssh/known_hosts || true
|
|
||||||
chmod 644 ~/.ssh/known_hosts
|
|
||||||
|
|
||||||
|
|
||||||
- name: Deploy to server via SSH ☁️
|
- name: Deploy to server via SSH ☁️
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
username: ${{ secrets.SERVER_USERNAME }}
|
username: ${{ secrets.SERVER_USERNAME }}
|
||||||
key_path: ~/.ssh/id_rsa
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
debug: true
|
debug: true
|
||||||
script: |
|
script: |
|
||||||
cd /var/www/codered-astra
|
cd /var/www/codered-astra
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue