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