Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: split packages into common and additional per distro #3

Merged
merged 5 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
matrix-builder:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -49,12 +53,20 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Generate Packages List
run: |
packages="$(cat common-packages | tr '\n' ' ')"
packages+=" $(cat "${{ matrix.distro }}/${{ matrix.codename }}/additional-packages" | tr '\n' ' ')"
echo "packages=$packages" >> $GITHUB_ENV

- name: Build & Push ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }} Image
uses: docker/build-push-action@v6.10.0
with:
context: .
platforms: "linux/${{ matrix.arch }}"
push: true
build-args: "REFERENCE=${{ matrix.distro }}:${{ matrix.codename }}"
build-args: |
"REFERENCE=${{ matrix.distro }}:${{ matrix.codename }}"
"PACKAGES=${{ env.packages }}"
file: ${{ matrix.distro }}/Dockerfile
tags: ghcr.io/${{ github.repository_owner }}/ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }}
59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test Docker Images

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
matrix-builder:
runs-on: ubuntu-24.04
outputs:
includes: ${{ steps.builder.outputs.includes }}
steps:
- name: Build Matrix
id: builder
uses: regolith-linux/actions/build-matrix@main
with:
type: "platform"
stage: "unstable"
arch: "amd64"

build:
runs-on: ubuntu-24.04
needs: matrix-builder

strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.matrix-builder.outputs.includes) }}

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Generate Packages List
run: |
packages="$(cat common-packages | tr '\n' ' ')"
packages+=" $(cat "${{ matrix.distro }}/${{ matrix.codename }}/additional-packages" | tr '\n' ' ')"
echo "packages=$packages" >> $GITHUB_ENV

- name: Build ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }} Image
uses: docker/build-push-action@v6.10.0
with:
context: .
platforms: "linux/${{ matrix.arch }}"
push: false
build-args: |
"REFERENCE=${{ matrix.distro }}:${{ matrix.codename }}"
"PACKAGES=${{ env.packages }}"
file: ${{ matrix.distro }}/Dockerfile
tags: ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }}
13 changes: 13 additions & 0 deletions common-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sudo
git
ca-certificates
wget
curl
jq
gpg
gpg-agent
devscripts
dput
diffutils
packaging-dev
git-buildpackage
20 changes: 4 additions & 16 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@ ARG REFERENCE=${REFERENCE:-debian:latest}
FROM $REFERENCE

ENV DEBIAN_FRONTEND="noninteractive"
WORKDIR /build

RUN apt update -qq && \
apt install --no-install-recommends -y \
sudo \
git \
ca-certificates \
wget \
curl \
jq \
gpg \
gpg-agent \
devscripts \
dput \
diffutils \
packaging-dev \
git-buildpackage
ARG PACKAGES=${PACKAGES:-sudo}
RUN apt update -qq && apt install --no-install-recommends -y $PACKAGES

WORKDIR /build
20 changes: 4 additions & 16 deletions ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@ ARG REFERENCE=${REFERENCE:-ubuntu:latest}
FROM $REFERENCE

ENV DEBIAN_FRONTEND="noninteractive"
WORKDIR /build

RUN apt update -qq && \
apt install --no-install-recommends -y \
sudo \
git \
ca-certificates \
wget \
curl \
jq \
gpg \
gpg-agent \
devscripts \
dput \
diffutils \
packaging-dev \
git-buildpackage
ARG PACKAGES=${PACKAGES:-sudo}
RUN apt update -qq && apt install --no-install-recommends -y $PACKAGES

WORKDIR /build