Skip to content

fedora41

fedora41 #94

Workflow file for this run

---
name: fedora41
on:
pull_request:
push:
paths:
- 'fedora41/**'
- '.github/workflows/fedora41.yml'
schedule:
- cron: '10 6,15 * * 1,6'
workflow_dispatch:
permissions: write-all
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
# Test the image builds and works correctly.
test:
name: Test fedora41
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4.1.1
- name: Test building image.
run: cd fedora41 && docker build -t fedora41 .
- name: Run the built image.
run: docker run --name test-container -d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:rw fedora41
# If on master branch, build and release image.
release:
name: Release
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ github.repository }}:fedora41
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image.
uses: docker/build-push-action@v5
with:
context: fedora41/
sbom: true
provenance: mode=max
file: fedora41/Dockerfile
platforms: linux/amd64, linux/arm64, linux/ppc64le, linux/s390x
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ github.repository }}:fedora41, ${{ github.repository }}:rawhide
labels: ${{ steps.meta.outputs.labels }}
- name: Docker Scout
id: docker-scout
if: ${{ github.event_name == 'pull_request' }}
uses: docker/scout-action@v1.6.3
with:
command: quickview,cves,recommendations,sbom,environment
image: ${{ steps.meta.outputs.tags }}
environment: prod
organization: shadownet
only-severities: critical,high,medium
exit-code: true
only-fixed: true