build disk image (release) #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build disk image (release) | |
run-name: build disk image (release) | |
on: | |
workflow_dispatch: | |
env: | |
IMAGE_NAME: ghcr.io/gbraad-redhat/fedora-bootc-example/fedora-bootc:latest | |
DISK_TYPE: qcow2 | |
ROOTFS: xfs | |
ARCH: amd64 | |
BIB_IMAGE: quay.io/centos-bootc/bootc-image-builder:latest | |
BODY: "Fedora base bootc image" | |
jobs: | |
build: | |
name: Build qcow2 image | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-24.04 | |
steps: | |
- name: Remove unwanted stuff | |
uses: gbraad-actions/remove-unwanted@v1 | |
- uses: actions/checkout@v4 | |
- name: Workaround podman issues in GH actions | |
run: | | |
# see https://github.com/osbuild/bootc-image-builder/issues/446 | |
sudo rm -rf /var/lib/containers/storage | |
sudo mkdir -p /etc/containers | |
echo -e "[storage]\ndriver = \"overlay\"\nrunroot = \"/run/containers/storage\"\ngraphroot = \"/var/lib/containers/storage\"" | sudo tee /etc/containers/storage.conf | |
- name: Workarounds for GH runner diskspace | |
run: | | |
# use custom basetemp here because /var/tmp is on a smaller disk | |
# than /mnt | |
sudo mkdir -p /mnt/var/tmp/bib-tests | |
# on GH runners /mnt has 70G free space, use that for our container | |
# storage | |
sudo mkdir -p /mnt/var/lib/containers | |
sudo mount -o bind /mnt/var/lib/containers /var/lib/containers | |
sudo mkdir /var/lib/containers/storage | |
- name: Build image | |
id: build-image | |
run: | | |
mkdir -p ./output | |
sed -e 's;@@IMAGE@@;${{ env.IMAGE_NAME }};g' config.toml.in > config.toml | |
sudo podman pull ${{ env.IMAGE_NAME }} | |
sudo podman run \ | |
--rm \ | |
-it \ | |
--privileged \ | |
--pull=newer \ | |
--security-opt label=type:unconfined_t \ | |
-v ./config.toml:/config.toml:ro \ | |
-v ./output:/output \ | |
-v /var/lib/containers/storage:/var/lib/containers/storage \ | |
${{ env.BIB_IMAGE }} \ | |
--target-arch ${{ env.ARCH }} \ | |
--type ${{ env.DISK_TYPE }} \ | |
--rootfs ${{ env.ROOTFS }} \ | |
--local \ | |
${{ env.IMAGE_NAME }} | |
- name: Create a GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: latest | |
name: Latest | |
body: ${{ env.BODY }} | |
artifacts: "output/bootiso/*.iso,./output/qcow2/*," |