Skip to content

Nightly DNF CI host container build #1380

Nightly DNF CI host container build

Nightly DNF CI host container build #1380

Workflow file for this run

---
name: Nightly DNF CI host container build
on:
schedule:
- cron: '0 2 * * *' # at 2am UTC
# allow to run the workflow manually from GitHub web interface
workflow_dispatch:
jobs:
container-build:
name: Container build
runs-on: ubuntu-latest
steps:
- name: Build the container
run: |
# hack: Github replaces secrets with *** in the whole output.
# If there's a comment (#) at the end of the secret
# (e.g. "rpm-sofware-management #"), this will clean it up and
# since it is no longer the whole secret being printed, Github
# won't hide it anymore.
GHCR_USER=${{secrets.GHCR_USER}}
if [ -z "$GHCR_USER" ]; then exit 0; fi
DATE=`date "+%F"`
IMAGE="ghcr.io/${GHCR_USER}/dnf-ci-host"
echo ${{secrets.GITHUB_TOKEN}} | docker login ghcr.io -u ${GHCR_USER} --password-stdin
docker build -t ${IMAGE}:${DATE} -t ${IMAGE}:latest -<<EOF
FROM fedora:latest
RUN dnf -y update
RUN dnf -y install dnf-plugins-core
RUN dnf -y copr enable rpmsoftwaremanagement/rpm-gitoverlay
RUN dnf -y install rpm-gitoverlay fuse-overlayfs parallel podman wget clang-tools-extra
# needed for dnf5's ccache builds
RUN dnf -y builddep https://raw.githubusercontent.com/rpm-software-management/dnf5/main/dnf5.spec
RUN dnf -y builddep --define="with_clang true" \
https://raw.githubusercontent.com/rpm-software-management/dnf5/main/dnf5.spec
RUN dnf -y install ccache
# needed for pre-commit hooks
# glibc-langpack-en is installed as a workaround
# see https://bugzilla.redhat.com/show_bug.cgi?id=2239860
RUN dnf -y install git python3-pip rpmlint glibc-langpack-en
# needed for moving of PIDs in integration-tests
RUN dnf -y install procps-ng
RUN dnf clean all # remove dnf cache to make the image smaller
EOF
docker push ${IMAGE}:${DATE}
docker push ${IMAGE}:latest