Skip to content

Commit 6cbd412

Browse files
committed
Adjust deployment action for self-hosted runners
1 parent 401af9d commit 6cbd412

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

.github/actions/deploy-action/action.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ inputs:
55
description: "The private SSH key used to authenticate with the remote servers"
66
required: true
77

8-
public_bastion_host_keys:
9-
description: "The public SSH host keys for the bastion server"
10-
required: true
11-
128
bastion_host:
139
description: "The [user@]hostname of the bastion server"
1410
required: true
@@ -33,7 +29,7 @@ runs:
3329
using: "composite"
3430
steps:
3531
- name: Configure ssh-agent for subsequent steps
36-
run: echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV
32+
run: echo "SSH_AUTH_SOCK=${{ runner.temp }}/ssh_agent.sock" >> $GITHUB_ENV
3733
shell: bash
3834

3935
- name: Start ssh-agent with SSH key
@@ -42,13 +38,6 @@ runs:
4238
ssh-add - <<< "${{ inputs.private_ssh_key }}"
4339
shell: bash
4440

45-
- name: Populate known hosts
46-
run: |
47-
mkdir -m 700 -p ~/.ssh
48-
printf "${{ inputs.public_bastion_host_keys }}" >> ~/.ssh/known_hosts
49-
chmod 600 ~/.ssh/known_hosts
50-
shell: bash
51-
5241
- name: Deploy to primary server
5342
run: rsync -avz --delete -e 'ssh -A ${{ inputs.bastion_host }} ssh' ${{ inputs.source }} ${{ inputs.primary_host }}:${{ inputs.destination }}
5443
shell: bash

.github/workflows/build-and-deploy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ jobs:
5757
uses: ./.github/actions/deploy-action
5858
with:
5959
private_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
60-
public_bastion_host_keys: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
6160
bastion_host: ${{ secrets.DEPLOY_BASTION_HOST }}
6261
primary_host: ${{ secrets.DEPLOY_PRIMARY_HOST }}
6362
secondary_host: ${{ secrets.DEPLOY_SECONDARY_HOST }}

0 commit comments

Comments
 (0)