Add GitHub Actions workflow for pull request builds and update Dockerfile dependencies

This commit is contained in:
Cédric Verstraeten
2025-09-09 16:28:19 +02:00
parent 1f9772d472
commit af3f8bb639
3 changed files with 99 additions and 10 deletions

65
.github/workflows/pr-build.yml vendored Normal file
View File

@@ -0,0 +1,65 @@
name: Build pull request
on:
pull_request:
types: [opened, synchronize]
env:
REPO: kerberos/agent
jobs:
build-amd64:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
architecture: [amd64]
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Checkout
uses: actions/checkout@v3
- uses: benjlevesque/short-sha@v2.1
id: short-sha
with:
length: 7
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Run Buildx
run: docker buildx build --platform linux/$(echo ${{matrix.architecture}} | tr - /) -t $REPO-arch:arch-${{matrix.architecture}}-${{github.event.inputs.tag || github.ref_name}} .
build-other:
runs-on: ubuntu-latest
permissions:
contents: write
needs: build-amd64
strategy:
matrix:
architecture: [arm64, arm-v7, arm-v6]
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Checkout
uses: actions/checkout@v3
- uses: benjlevesque/short-sha@v2.1
id: short-sha
with:
length: 7
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Run Buildx
run: docker buildx build --platform linux/$(echo ${{matrix.architecture}} | tr - /) -t $REPO-arch:arch-${{matrix.architecture}}-${{github.event.inputs.tag || github.ref_name}} .

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
ui/node_modules
ui/build
ui/public/assets/env.js
.DS_Store
.idea
machinery/www
yarn.lock

View File

@@ -1,21 +1,44 @@
ARG BASE_IMAGE_VERSION=70ec57e
FROM kerberos/base:${BASE_IMAGE_VERSION} AS build-machinery
LABEL AUTHOR=Kerberos.io
ENV GOROOT=/usr/local/go
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:$GOROOT/bin:/usr/local/lib:$PATH
ENV GOSUMDB=off
FROM mcr.microsoft.com/devcontainers/go:1.24-bookworm AS build-machinery
LABEL AUTHOR=uug.ai
##########################################
# Installing some additional dependencies.
RUN apt-get upgrade -y && apt-get update && apt-get install -y --fix-missing --no-install-recommends \
RUN apt-get update && apt-get upgrade -y && apt-get install -y --fix-missing --no-install-recommends \
git build-essential cmake pkg-config unzip libgtk2.0-dev \
curl ca-certificates libcurl4-openssl-dev libssl-dev libjpeg62-turbo-dev && \
curl ca-certificates libcurl4-openssl-dev libssl-dev libjpeg62-turbo-dev \
libc-ares-dev uuid-dev daemon libwebsockets-dev \
dh-autoreconf autotools-dev autoconf automake gcc \
libtool make nasm tar && \
rm -rf /var/lib/apt/lists/*
#############################
# Static build x264
RUN git clone https://code.videolan.org/videolan/x264.git && \
cd x264 && git checkout 0a84d986 && \
./configure --prefix=/usr/local --enable-static --enable-pic && \
make && \
make install && \
cd .. && rm -rf x264
#################################
# Clone and build FFMpeg & OpenCV
RUN git clone https://github.com/FFmpeg/FFmpeg && \
cd FFmpeg && git checkout n6.0.1 && \
./configure --prefix=/usr/local --target-os=linux --enable-nonfree \
--extra-ldflags="-latomic" \
--enable-avfilter \
--disable-zlib \
--enable-gpl \
--extra-libs=-latomic \
--enable-static --disable-shared && \
make && \
make install && \
cd .. && rm -rf FFmpeg
##############################################################################
# Copy all the relevant source code in the Docker image, so we can build this.