Skip to content

Commit

Permalink
add ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
askhalil committed Oct 20, 2024
1 parent 442e0dd commit 7ff2835
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build and Run Go Program

on: [pull_request]
on: [push]

jobs:
build:
Expand All @@ -10,6 +10,19 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
run: |
mkdir -p /home/runner/.ssh
ssh-keyscan $SSH_HOST >> /home/runner/.ssh/known_hosts
echo "$SSH_PRIVATE_KEY" > /home/runner/.ssh/github_actions
chmod 600 /home/runner/.ssh/github_actions
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add /home/runner/.ssh/github_actions
ssh $SSH_USERNAME@$SSH_HOST "echo 'Hello from GitHub Actions'"
- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down

0 comments on commit 7ff2835

Please sign in to comment.