2024-09-06 13:55:30 -07:00
|
|
|
name: SSH and echo to file
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-10-24 15:35:10 -07:00
|
|
|
branches: [ main ]
|
|
|
|
paths: [ 'homelab/vyos/config.boot' ]
|
2024-09-06 13:55:30 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
ssh:
|
2024-10-24 16:29:41 -07:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: homelab/vyos
|
2024-09-06 13:55:30 -07:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-10-24 15:46:48 -07:00
|
|
|
- name: Checkout Jafner.net repo
|
|
|
|
uses: actions/checkout@v4
|
2024-10-24 23:39:51 -07:00
|
|
|
- name: Check network connectivity to host
|
|
|
|
run: ping -c 1 -t 1 -q 192.168.1.1
|
|
|
|
- name: Configure SSH
|
2024-10-24 15:50:10 -07:00
|
|
|
run: |
|
2024-10-24 16:35:40 -07:00
|
|
|
echo -e "${{ secrets.RUNNER_SSH_PRIVATEKEY }}" > /tmp/key
|
2024-10-24 16:42:13 -07:00
|
|
|
chmod 0600 /tmp/key
|
|
|
|
ssh-keygen -y -f /tmp/key > /tmp/key.pub
|
|
|
|
ssh-keygen -l -E sha256 -f /tmp/key.pub
|
2024-10-24 19:50:22 -07:00
|
|
|
mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts
|
|
|
|
ssh-keyscan 192.168.1.1 > ~/.ssh/known_hosts
|
|
|
|
chmod 0600 ~/.ssh/known_hosts
|
2024-10-24 16:29:41 -07:00
|
|
|
- name: Print running VyOS version
|
|
|
|
run: |
|
2024-10-24 23:39:51 -07:00
|
|
|
whoami
|
2024-10-24 16:29:41 -07:00
|
|
|
./vyos.sh op show system image
|
|
|
|
|
|
|
|
# - name: SSH into host
|
|
|
|
# uses: appleboy/ssh-action@v1.1.0
|
|
|
|
# with:
|
|
|
|
# host: 192.168.1.1
|
|
|
|
# username: vyos
|
|
|
|
# key: ${{ secrets.RUNNER_SSH_PRIVATEKEY }}
|
|
|
|
# debug: true
|
|
|
|
# script: |
|
|
|
|
# echo "$(date)" >> ~/hello.txt
|