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 9c8277c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 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,18 @@ 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-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 9c8277c

Please sign in to comment.