Skip to content

Commit

Permalink
wiop
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Jan 24, 2024
1 parent d893dd2 commit 7acf8ef
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/rawdisk-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and Push raw disk image

on:
schedule:
- cron: "50 */4 * * *"

workflow_dispatch:

env:
REGISTRY_NS: quay.io/centos-bootc
# TODO use quay once it supports artifacts
DISKIMAGE_REGISTRY: ghcr.io

jobs:
build-and-push-cloud-qcow2-image:
runs-on: ubuntu-latest

strategy:
matrix:
# os: [fedora, centos]
os: [fedora]
include:
- os: fedora
tag: eln
- os: centos
tag: stream9

steps:
# TODO replace with https://github.com/containers/buildah/issues/5091
- name: Install oras
run: |
VERSION="1.1.0"
curl -L "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz" | tar zxvf -
sudo mv oras /usr/bin
- name: Install podman
run: sudo apt install podman

- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Login to quay.io
run: podman login --authfile auth.json -u ${{ github.triggering_actor }} --password ${{ secrets.GITHUB_TOKEN }} ${{ env.DISKIMAGE_REGISTRY }}

- name: Build raw disk image
run: |
mkdir -p output
truncate -s 10G output/image.raw
sudo podman run --rm -it --privileged --pull=newer \
-v $(pwd)/output:/output \
${{ env.REGISTRY_NS }}/${{ matrix.os }}:${{ matrix.tag }} \
bootc install to-disk --generic-image --via-loopback /output/myimage.raw
zstd --rm --sparse output/image.raw
- name: Push
run: |
IMAGE_NAME=${{ env.DISKIMAGE_REGISTRY }}/${{ github.repository_owner }}/${{ matrix.os }}-rawdisk:${{ matrix.tag }}
IMAGE_NAME=$(echo $IMAGE_NAME | tr '[A-Z]' '[a-z]')
oras push --debug --registry-config auth.json $IMAGE_NAME \
image.raw.zst:application/x-raw-disk+zstd

0 comments on commit 7acf8ef

Please sign in to comment.