From 06ee39499e91966f7149375b1d1bdee1f7e1af1f Mon Sep 17 00:00:00 2001 From: Nicola Sella Date: Wed, 14 Feb 2024 17:10:59 +0100 Subject: [PATCH] Add a job for Fedora container with dnf5 --- .github/workflows/dnf5-fedora.yml | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/dnf5-fedora.yml diff --git a/.github/workflows/dnf5-fedora.yml b/.github/workflows/dnf5-fedora.yml new file mode 100644 index 000000000..3b491a412 --- /dev/null +++ b/.github/workflows/dnf5-fedora.yml @@ -0,0 +1,40 @@ +--- +name: DNF5 Fedora 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}/dnf5-fedora" + + echo ${{secrets.GITHUB_TOKEN}} | docker login ghcr.io -u ${GHCR_USER} --password-stdin + + docker build -t ${IMAGE}:${DATE} -t ${IMAGE}:latest -<