Skip to content

Commit

Permalink
Add quay.io action
Browse files Browse the repository at this point in the history
Provides the images fedora-dnf5 and fedora-dnf5-nightly which come with
DNF5 pre-installed

Provides:
- fedora-dnf5:
    Fedora with DNF5 installed from repos
- fedora-dnf5-nightly
    Fedora with DNF5 installed from COPR rpmsoftwaremanagement/dnf-nightly
- fedora-dnf5-testing
    Fedora with DNF5 installed and DNF obsoleted i.e. with DNF5 installed
    from COPR rpmsoftwaremanagement/dnf5-testing
- fedora-dnf5-testing-nightly
    Fedora with DNF5 nightly installed and DNF obsoleted i.e. with DNF5
    installed from COPR rpmsoftwaremanagement/dnf5-testing-nightly

All images are built following fedora tags 38, 39, 40, stable, latest
and rawhide
  • Loading branch information
inknos committed Feb 22, 2024
1 parent a40c687 commit b55c397
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/container-build-quay-io.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: Build DNF5 containers on quay.io
on:
schedule:
- cron: '0 4 * * *' # at 4am UTC, 2 hours after nightlies are built
workflow_dispatch:


# from https://github.com/marketplace/actions/push-to-registry
jobs:
build:
name: Build and push image
strategy:
fail_fast: false
matrix:
name:
- dnf5
- dnf5-nightly
- dnf5-testing
- dnf5-testing-nightly
tag:
- 38
- 39
- stable
- latest
- rawhide

runs_on: ubuntu:20.04

steps:
- uses: actions/checkout@v2

- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: rpmsoftwaremanagement/fedora-${{ matrix.name }}
tags: ${{ matrix.tag }}
containerfiles: |
.containerfiles/Containerfile
build_args:
TAG=${{ matrix.tag }}
NAME=${{ matrix.name }}

# Podman Login action (https://github.com/redhat-actions/podman-login) also be used to log in,
# in which case 'username' and 'password' can be omitted.
- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/rpmsoftwaremanagement
username: ${{ secrets.QUAY_IO_REGISTRY_USERNAME }}
password: ${{ secrets.QUAY_IO_REGISTRY_PASSWORD }}

- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
26 changes: 26 additions & 0 deletions containerfiles/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM fedora:$TAG

ARG TAG
ARG NAME

RUN dnf -y update \
&& dnf -y install 'dnf-command(copr)' \

# enable nightly repositories
&& if [ "$NAME" == "dnf5-nightly" ]; then \
dnf copr -y enable rpmsoftwaremanagement/dnf-nightly ; \
fi \

# enable testing repositories
&& if [ "$NAME" == "dnf5-testing" ] || [ "$NAME" == "dnf5-testing-nightly" ]; then \
dnf copr -y enable rpmsoftwaremanagement/"$NAME" ; \
fi \

# install all the DNF5 stack
&& dnf -y install dnf5 dnf-data dnf5-plugins \

# clean installed packages
# from this on we need to be careful to specify which dnf to use
&& dnf4 -y remove 'dnf-command(copr)' \
&& dnf4 clean all \
&& dnf5 clean all

0 comments on commit b55c397

Please sign in to comment.