Skip to content

Commit 8ea13e9

Browse files
Uriel AlonsoUriel Alonso
authored andcommitted
Update deploy workflow SSH setup
1 parent 82f14e9 commit 8ea13e9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,24 @@ jobs:
6565
username: ${{ github.repository_owner }}
6666
password: ${{ secrets.GHCR_TOKEN }}
6767

68-
- name: Set up SSH key
68+
- name: Set up SSH
6969
run: |
7070
mkdir -p ~/.ssh
7171
echo "${{ secrets.LIGHTSAIL_SSH_KEY }}" > ~/.ssh/lightsail_key
7272
chmod 600 ~/.ssh/lightsail_key
73+
7374
ssh-keygen -R "${{ vars.LIGHTSAIL_HOST }}" || true
7475
ssh-keyscan -H "${{ vars.LIGHTSAIL_HOST }}" >> ~/.ssh/known_hosts
7576
77+
cat > ~/.ssh/config <<EOF
78+
Host ${{ vars.LIGHTSAIL_HOST }}
79+
User ubuntu
80+
IdentityFile ~/.ssh/lightsail_key
81+
IdentitiesOnly yes
82+
StrictHostKeyChecking yes
83+
EOF
84+
chmod 600 ~/.ssh/config
85+
7686
- name: Start ssh-agent
7787
run: |
7888
eval "$(ssh-agent -s)"

config/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ env:
2929
ssh:
3030
user: ubuntu
3131
keys_only: true
32-
config: false
32+
config: true

0 commit comments

Comments
 (0)