Refactor GitHub Actions workflow for ISO build
This commit is contained in:
@@ -6,14 +6,13 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-iso:
|
build-iso:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: read
|
packages: read
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4 # v4 ist aktuell und stabil
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Free disk space
|
- name: Free disk space
|
||||||
run: |
|
run: |
|
||||||
@@ -21,6 +20,7 @@ jobs:
|
|||||||
sudo rm -rf /usr/local/lib/android
|
sudo rm -rf /usr/local/lib/android
|
||||||
sudo rm -rf /opt/ghc
|
sudo rm -rf /opt/ghc
|
||||||
sudo rm -rf /opt/hostedtoolcache
|
sudo rm -rf /opt/hostedtoolcache
|
||||||
|
sudo docker image prune -af
|
||||||
df -h
|
df -h
|
||||||
|
|
||||||
- name: Prepare output directory
|
- name: Prepare output directory
|
||||||
@@ -28,22 +28,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Login to GHCR
|
- name: Login to GHCR
|
||||||
run: |
|
run: |
|
||||||
# Wir nutzen hier kein sudo für den Login,
|
echo "${{ secrets.GITHUB_TOKEN }}" | sudo podman login ghcr.io \
|
||||||
# sondern authentifizieren den User-Space
|
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io \
|
|
||||||
-u ${{ github.actor }} --password-stdin
|
-u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
- name: Pull base image
|
- name: Pull base image
|
||||||
run: |
|
run: |
|
||||||
# Pull ohne sudo, damit die Layer im User-Storage liegen
|
sudo podman pull ghcr.io/humocs-man/fluffy-pancake:stable
|
||||||
podman pull ghcr.io/humocs-man/fluffy-pancake:stable
|
|
||||||
|
|
||||||
- name: Build ISO (Interactive Mode)
|
- name: Build ISO
|
||||||
run: |
|
run: |
|
||||||
# Wir nutzen absolute Pfade mit ${{ github.workspace }}
|
|
||||||
# WICHTIG: Der bootc-image-builder braucht Zugriff auf den lokalen Podman-Sockel
|
|
||||||
# oder das Storage-Verzeichnis, um das Image zu finden.
|
|
||||||
|
|
||||||
sudo podman run --rm --privileged \
|
sudo podman run --rm --privileged \
|
||||||
-v ${{ github.workspace }}/iso/config.toml:/config.toml:ro \
|
-v ${{ github.workspace }}/iso/config.toml:/config.toml:ro \
|
||||||
-v ${{ github.workspace }}/output:/output \
|
-v ${{ github.workspace }}/output:/output \
|
||||||
@@ -56,74 +49,8 @@ jobs:
|
|||||||
ghcr.io/humocs-man/fluffy-pancake:stable
|
ghcr.io/humocs-man/fluffy-pancake:stable
|
||||||
|
|
||||||
- name: Upload ISO artifact
|
- name: Upload ISO artifact
|
||||||
uses: actions/upload-artifact@v4 # v4 ist die aktuelle Version
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: installer-iso
|
name: installer-iso
|
||||||
path: output/anaconda-iso/deploy.iso # Der Builder erstellt meist diese Unterstruktur
|
path: output/anaconda-iso/*.iso
|
||||||
if-no-files-found: errorname: Build Installer ISO
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
#push:
|
|
||||||
#branches:
|
|
||||||
#- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-iso:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: read
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
|
|
||||||
- name: Free disk space
|
|
||||||
run: |
|
|
||||||
sudo rm -rf /usr/share/dotnet
|
|
||||||
sudo rm -rf /usr/local/lib/android
|
|
||||||
sudo rm -rf /opt/ghc
|
|
||||||
sudo rm -rf /opt/hostedtoolcache
|
|
||||||
df -h
|
|
||||||
|
|
||||||
|
|
||||||
- name: Prepare output directory
|
|
||||||
run: mkdir -p output
|
|
||||||
|
|
||||||
- name: Login to GHCR
|
|
||||||
run: |
|
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | sudo podman login ghcr.io \
|
|
||||||
-u ${{ github.actor }} --password-stdin
|
|
||||||
|
|
||||||
|
|
||||||
# Wichtig: Den Pull explizit machen, damit Layer im lokalen Storage landen
|
|
||||||
- name: Pull base image
|
|
||||||
run: |
|
|
||||||
# Falls das Image privat ist, hier ein 'sudo podman login' davor setzen
|
|
||||||
sudo podman pull ghcr.io/humocs-man/fluffy-pancake:stable
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: Build ISO (Interactive Mode)
|
|
||||||
run: |
|
|
||||||
# Wir mounten /var/lib/containers/storage, damit der Builder
|
|
||||||
# das oben gepullte Image direkt findet.
|
|
||||||
sudo podman run --rm --privileged \
|
|
||||||
-v ./iso/config.toml:/config.toml:ro \
|
|
||||||
-v ./output:/output \
|
|
||||||
-v /var/lib/containers/storage:/var/lib/containers/storage \
|
|
||||||
quay.io/centos-bootc/bootc-image-builder:latest \
|
|
||||||
--type anaconda-iso \
|
|
||||||
--rootfs btrfs \
|
|
||||||
--config /config.toml \
|
|
||||||
--output /output/ \
|
|
||||||
ghcr.io/humocs-man/fluffy-pancake:stable
|
|
||||||
|
|
||||||
- name: Upload ISO artifact
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: installer-iso
|
|
||||||
path: output/**/*.iso
|
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|||||||
Reference in New Issue
Block a user