build: Start virtual machine w/ cloud-init configuration
All checks were successful
build-image / Build image (push) Successful in 6m36s
All checks were successful
build-image / Build image (push) Successful in 6m36s
This commit is contained in:
@ -50,17 +50,27 @@ jobs:
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Create folder structure
|
||||
run: |
|
||||
mkdir -p \
|
||||
ubuntu-vm
|
||||
- name: Download source Ubuntu iso
|
||||
run: |
|
||||
curl -L \
|
||||
https://sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2024.04/ubuntu-24.04-server-cloudimg-amd64.img \
|
||||
-o ubuntu-vm/ubuntu.img \
|
||||
-u ${{ secrets.REPO_USERNAME }}:${{ secrets.REPO_PASSWORD }}
|
||||
- name: Generate seed ISO
|
||||
shell: bash
|
||||
run: |
|
||||
apt-get update && \
|
||||
apt-get install -y \
|
||||
gettext \
|
||||
genisoimage
|
||||
|
||||
envsubst < cloud-init/user-data.template > cloud-init/user-data
|
||||
|
||||
genisoimage \
|
||||
-output seed.iso \
|
||||
-output ubuntu-vm/seed.iso \
|
||||
-volid cidata \
|
||||
-joliet \
|
||||
-rock \
|
||||
@ -68,6 +78,25 @@ jobs:
|
||||
env:
|
||||
ROOT_HASHED_PASSWORD: ${{ secrets.ROOT_HASHED_PASSWORD }}
|
||||
PUBLIC_SSHKEY: ${{ secrets.PUBLIC_SSHKEY }}
|
||||
- name: Start virtual machine
|
||||
run: |
|
||||
apt-get update && \
|
||||
apt-get install -y \
|
||||
qemu-system-x86 \
|
||||
qemu-utils
|
||||
|
||||
[ -e /dev/kvm ] && kvm_flag="-enable-kvm" || kvm_flag=""
|
||||
|
||||
qemu-system-x86_64 \
|
||||
$kvm_flag \
|
||||
-m 3072 \
|
||||
-smp 2 \
|
||||
-cpu host \
|
||||
-drive file=ubuntu-vm/ubuntu.img,if=virtio,format=qcow2 \
|
||||
-drive file=ubuntu-vm/seed.iso,format=raw,media=cdrom \
|
||||
-nographic \
|
||||
-net nic \
|
||||
-net user
|
||||
|
||||
# semrel:
|
||||
# name: Semantic Release
|
||||
|
Reference in New Issue
Block a user