From 89dcf40f03e108491164592cc074ea5b088bbde7 Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Tue, 5 Dec 2023 18:59:33 -0500 Subject: [PATCH] .github: workflows: build kernel development containers Signed-off-by: Peter Colberg --- .github/workflows/container.yml | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/container.yml diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 00000000..03191d49 --- /dev/null +++ b/.github/workflows/container.yml @@ -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"