Skip to content

Commit

Permalink
.github: workflows: build kernel development containers
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
  • Loading branch information
pcolberg committed Dec 6, 2023
1 parent 4cc86e3 commit 89dcf40
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build kernel development containers

permissions:
packages: write

on:
push:
branches:
- 'main'
paths:
- '.github/workflows/container.yml'
- 'container/**'

pull_request:
branches:
- 'main'
paths:
- '.github/workflows/container.yml'
- 'container/**'

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
image:
- rockylinux-8-kernel-devel
- ubuntu-22.04-kernel-devel

env:
image: ghcr.io/ofs/linux-dfl-backport/${{ matrix.image }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build kernel development image
run: docker build -t "$image" -f container/${{ matrix.image }}/Dockerfile .

- name: Log in to registry
if: github.event_name == 'push'
run: echo "$token" | docker login ghcr.io -u "$GITHUB_REPOSITORY_OWNER" --password-stdin
env:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Push image to registry
if: github.event_name == 'push'
run: docker image push "$image"

0 comments on commit 89dcf40

Please sign in to comment.