build: Add virt-install steps
Some checks failed
build-image / Build image (push) Failing after 24s

This commit is contained in:
2025-07-25 15:59:44 +10:00
parent 2f3c6b3c9c
commit ade3e4293c

View File

@ -50,8 +50,11 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Create folder structure
run: |
mkdir -p \
ubuntu-vm
- name: Generate seed ISO
shell: bash
run: |
apt-get update && \
apt-get install -y \
@ -60,14 +63,38 @@ jobs:
envsubst < cloud-init/user-data.template > cloud-init/user-data
genisoimage \
-output seed.iso \
-output ubuntu-vm/seed.iso \
-volid cidata \
-joliet \
-rock \
cloud-init/meta-data cloud-init/user-data
ls -lash ubuntu-vm
env:
ROOT_HASHED_PASSWORD: ${{ secrets.ROOT_HASHED_PASSWORD }}
PUBLIC_SSHKEY: ${{ secrets.PUBLIC_SSHKEY }}
- name: Download Ubuntu ISO
run: |
if [ ! -f ubuntu-vm/ubuntu-24.04.iso ]; then
curl -L -o ubuntu-vm/ubuntu-24.04.iso https://releases.ubuntu.com/24.04/ubuntu-24.04.2-desktop-amd64.iso
fi
- name: Create empty QCOW2 disk
run: |
qemu-img create -f qcow2 ubuntu-vm/ubuntu.qcow2 10G
- name: Run virt-install
run: |
virt-install \
--name ubuntu-harvester \
--ram 2048 \
--vcpus 2 \
--disk path=ubuntu-vm/ubuntu.qcow2,size=10,format=qcow2 \
--disk path=ubuntu-vm/seed.iso,device=cdrom \
--cdrom ubuntu-vm/ubuntu-24.04.iso \
--os-variant ubuntu24.04 \
--graphics none \
--network network=default \
--noautoconsole \
--wait -1
# semrel:
# name: Semantic Release