1
0
Fork 0
mirror of https://github.com/JasonN3/build-container-installer.git synced 2025-12-25 10:57:55 +01:00
build-container-installer/.github/workflows/iso.yml
2024-02-13 14:35:11 +00:00

130 lines
3.3 KiB
YAML

name: Create and publish an ISO
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
jobs:
build-docker_cache-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Checkout push-to-registry action GitHub repository
- name: Checkout Push to Registry action
uses: actions/checkout@v4
# Build image using Buildah action
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
containerfiles: |
./containers/docker_cache/Containerfile
context: containers/docker_cache
image: docker_cache
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v6
with:
string: ${{ env.IMAGE_REGISTRY }}
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
id: push
if: github.event_name != 'pull_request'
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
with:
image: ${{ steps.build_image.outputs.image }}
tags: latest
registry: ${{ steps.registry_case.outputs.lowercase }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
extra-args: |
--disable-content-trust
build-and-push-iso:
runs-on: ubuntu-latest
needs:
- build-docker_cache-container
container:
image: fedora:39
options: "--privileged"
volumes:
- registry_cache:/registry_cache
services:
dockerregistry:
image: ghcr.io/jasonn3/docker_cache:latest
ports:
- 5000:5000
volumes:
- registry_cache:/var/lib/registry
permissions:
contents: read
packages: write
steps:
- name: Install Tools
run: |
dnf install -y \
lorax \
podman \
git
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Mark local registry as http
run: |
cat << EOF >> /etc/containers/registries.conf
[[registry]]
location = "dockerregistry:5000"
insecure = true
EOF
- name: Download container to cache
run: |
podman pull dockerregistry:5000/ublue-os/base-main:39
- name: Show downloaded files
run: |
find /registry_cache
- name: Create boot.iso
env:
version: "39"
arch: "x86_64"
run: |
lorax -p Fedora -v $version -r $version -t Server \
--isfinal --buildarch=${arch} --volid=Fedora-S-dvd-${arch}-${version} \
--macboot --noupgrade \
--repo /etc/yum.repos.d/fedora.repo \
--enablerepo fedora \
--repo /etc/yum.repos.d/fedora-updates.repo \
--enablerepo updates \
-i podman \
./results/
- name: Upload ISO as Artifact
uses: actions/upload-artifact@v4
with:
name: Fedora-LiveCD.iso
path: results/images/boot.iso
if-no-files-found: error
retention-days: 0
compression-level: 0
overwrite: true