Files
fedora-dev/.github/workflows/build.yml

62 lines
1.5 KiB
YAML

name: Build Container Images
on:
push:
branches: [ "main" ]
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_PREFIX: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
image:
- name: rpmbuild
context: ./rpmbuild
- name: kernel
context: ./kernel
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/${{ matrix.image.name }}
tags: |
type=raw,value=latest
type=raw,value={{date 'YYYYMMDD'}}
- name: Build and push ${{ matrix.image.name }}
uses: docker/build-push-action@v5
with:
context: ${{ matrix.image.context }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max