Skip to content

Commit edccace

Browse files
committed
refactor: Simplify Tailscale SSH commands by removing known hosts configuration
1 parent 0d6eb38 commit edccace

1 file changed

Lines changed: 3 additions & 20 deletions

File tree

.github/workflows/deploy-tailscale.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ jobs:
6464
sanitized_target="${user_prefix}${host_only}${port_suffix}"
6565
echo "target=$sanitized_target" >> "$GITHUB_OUTPUT"
6666
67-
- name: Configure SSH known hosts
68-
shell: bash
69-
run: |
70-
mkdir -p "$HOME/.ssh"
71-
touch "$HOME/.ssh/tailscale_known_hosts"
72-
chmod 600 "$HOME/.ssh/tailscale_known_hosts"
73-
echo "TAILSCALE_KNOWN_HOSTS=$HOME/.ssh/tailscale_known_hosts" >> "$GITHUB_ENV"
74-
7567
- name: Validate deployment secrets
7668
run: |
7769
if [ -z "${{ steps.prepare.outputs.target }}" ]; then
@@ -86,25 +78,16 @@ jobs:
8678
- name: Test Tailscale connectivity
8779
run: |
8880
echo "Testing connection to target host..."
89-
tailscale ssh "${{ steps.prepare.outputs.target }}" \
90-
-o StrictHostKeyChecking=accept-new \
91-
-o UserKnownHostsFile="$TAILSCALE_KNOWN_HOSTS" \
92-
"echo 'Connected successfully' && whoami"
81+
tailscale ssh "${{ steps.prepare.outputs.target }}" "echo 'Connected successfully' && whoami"
9382
9483
- name: Deploy through Tailscale SSH
9584
run: |
9685
echo "🚀 Starting deployment..."
97-
tailscale ssh "${{ steps.prepare.outputs.target }}" \
98-
-o StrictHostKeyChecking=accept-new \
99-
-o UserKnownHostsFile="$TAILSCALE_KNOWN_HOSTS" \
100-
"${TAILSCALE_DEPLOY_COMMAND}"
86+
tailscale ssh "${{ steps.prepare.outputs.target }}" "${TAILSCALE_DEPLOY_COMMAND}"
10187
echo "✅ Deployment completed"
10288
10389
- name: Post-deployment verification (optional)
10490
if: success()
10591
run: |
10692
echo "Verifying deployment..."
107-
tailscale ssh "${{ steps.prepare.outputs.target }}" \
108-
-o StrictHostKeyChecking=accept-new \
109-
-o UserKnownHostsFile="$TAILSCALE_KNOWN_HOSTS" \
110-
"systemctl status your-app || echo 'Status command not available'"
93+
tailscale ssh "${{ steps.prepare.outputs.target }}" "systemctl status your-app || echo 'Status command not available'"

0 commit comments

Comments
 (0)