Skip to content

compose-os

compose-os #1508

Workflow file for this run

---
name: compose-os
on:
push:
branches:
- main
paths-ignore:
- LICENSE
- README.md
schedule:
- cron: 30 0,6,12,18 * * *
workflow_dispatch: {}
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
gh_registry: ghcr.io
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- fedora-kmods
version:
- 40
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate variables
run: |
echo "datestamp=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
echo "registry=${{ env.gh_registry }}/${{ github.repository_owner }}" >> $GITHUB_ENV
echo "image=${{ matrix.os }}:${{ matrix.version }}" >> $GITHUB_ENV
- name: Log in to registry
run: |
podman login --username ${{ github.actor }} --password ${{ github.token }} ${registry}
- name: Build and push container
run: |
podman build --no-cache --build-arg FEDORA_VERSION=${{ matrix.version }} --tag ${image} --file Containerfile.${{ matrix.os }}
podman push ${image} ${registry}/${image}
- name: Log out of registry
run: |
podman logout ${registry}
compose:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- fedora-minimal
- fedora-custom
- fedora-silverblue
version:
- 40
container:
image: quay.io/fedora/fedora-minimal:${{ matrix.version }}
options: '--user root --privileged -v /var/tmp:/var/tmp -v /tmp:/tmp'
steps:
- name: Install dependencies
run: |
dnf5 makecache
ARGS="--assumeyes --setopt install_weak_deps=false"
if [[ "$(dnf5 repoquery rpm-ostree --quiet --queryformat '%{version}')" == 2023.7 ]]; then
ARGS+=" --enablerepo updates-testing"
fi
dnf5 install ${ARGS} distribution-gpg-keys fuse-overlayfs git-core just podman rpm-ostree selinux-policy-targeted tar
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate variables
run: |
echo "datestamp=$(date +%Y%m%d)" >> $GITHUB_ENV
echo "registry=${{ env.gh_registry }}/${{ github.repository_owner }}" >> $GITHUB_ENV
echo "image=${{ matrix.os }}:${{ matrix.version }}" >> $GITHUB_ENV
- name: Log in to registry
run: |
podman login --username ${{ github.actor }} --password ${{ github.token }} ${registry}
- name: Build and push ostree container
run: |
rpm-ostree compose image --format=registry --initialize-mode if-not-exists ${{ matrix.os }}.yaml ${registry}/${image}
- name: Log out of registry
run: |
podman logout ${registry}