This commit is contained in:
parent
66387734d8
commit
3658fb2285
1 changed files with 37 additions and 0 deletions
37
.forgejo/workflows/build-image.yml
Normal file
37
.forgejo/workflows/build-image.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
name: "Build NixOS Image and Upload to Proxmox"
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # Manual trigger
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-upload:
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- name: Checkout flake
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Nix
|
||||||
|
uses: cachix/install-nix-action@v22
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
|
||||||
|
- name: Build Proxmox image
|
||||||
|
run: |
|
||||||
|
nix build .#base
|
||||||
|
|
||||||
|
- name: Upload to Proxmox
|
||||||
|
env:
|
||||||
|
PROXMOX_HOST: ${{ secrets.PROXMOX_HOST }}
|
||||||
|
PROXMOX_USER: ${{ secrets.PROXMOX_USER }}
|
||||||
|
PROXMOX_PASSWORD: ${{ secrets.PROXMOX_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
scp result/*.vma.zst "$PROXMOX_USER@$PROXMOX_HOST:/var/lib/vz/dump/"
|
||||||
|
|
||||||
|
- name: Replace template on Proxmox
|
||||||
|
run: |
|
||||||
|
ssh "$PROXMOX_USER@$PROXMOX_HOST" "
|
||||||
|
qmrestore /var/lib/vz/dump/nixos-base.vma.zst 9000 --unique=true &&
|
||||||
|
qm set 9000 --name nixos-base --cores 2 --memory 2048 &&
|
||||||
|
qm template 9000
|
||||||
|
"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue