ssh
This commit is contained in:
parent
c1a600363a
commit
eef45b8158
1 changed files with 18 additions and 7 deletions
|
|
@ -10,12 +10,8 @@ jobs:
|
|||
build:
|
||||
runs-on: nixos-latest
|
||||
env:
|
||||
PROXMOX_HOST: 192.168.1.205
|
||||
PROXMOX_USER: forgejo-runner
|
||||
NIXOS_BUILER_HOST: nixos-builder.lab
|
||||
NIXOS_BUILER_USER: runner
|
||||
TEMPLATE_VMID: 9001
|
||||
LATEST_TEMPLATE_VMID: 9000
|
||||
|
||||
steps:
|
||||
- name: Install nodejs
|
||||
|
|
@ -34,13 +30,10 @@ jobs:
|
|||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.RUNNER_SSH_KEY }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -H $PROXMOX_HOST >> ~/.ssh/known_hosts
|
||||
ssh-keyscan -H $NIXOS_BUILER_HOST >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Test SSH connection
|
||||
run: |
|
||||
echo "Testing SSH connection to $PROXMOX_HOST..."
|
||||
ssh -o StrictHostKeyChecking=yes $PROXMOX_USER@$PROXMOX_HOST "echo 'SSH success. Hostname:' && hostname"
|
||||
echo "Testing SSH connection to $NIXOS_BUILER_HOST..."
|
||||
ssh -o StrictHostKeyChecking=yes $NIXOS_BUILER_USER@$NIXOS_BUILER_HOST "echo 'SSH success. Hostname:' && hostname"
|
||||
|
||||
|
|
@ -72,6 +65,12 @@ jobs:
|
|||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
if: success()
|
||||
env:
|
||||
PROXMOX_HOST: 192.168.1.205
|
||||
PROXMOX_USER: forgejo-runner
|
||||
TEMPLATE_VMID: 9001
|
||||
LATEST_TEMPLATE_VMID: 9000
|
||||
|
||||
steps:
|
||||
- name: Download Artifact
|
||||
id: artifact
|
||||
|
|
@ -88,6 +87,18 @@ jobs:
|
|||
echo "tag=dev-$(date +%s)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Prepare SSH
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.RUNNER_SSH_KEY }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -H $PROXMOX_HOST >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Test SSH connection
|
||||
run: |
|
||||
echo "Testing SSH connection to $PROXMOX_HOST..."
|
||||
ssh -o StrictHostKeyChecking=yes $PROXMOX_USER@$PROXMOX_HOST "echo 'SSH success. Hostname:' && hostname"
|
||||
|
||||
- name: Upload image to Proxmox and manage templates
|
||||
run: |
|
||||
set -e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue