Skip to content
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/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
releaseBranch:
description: 'Release Branch (releases/mXXX)'
required: true
tagSuffix:
description: 'Optional image tag suffix (e.g. "hooksfix" → 2.333.1-hooksfix)'
required: false
default: ''

jobs:
publish-image:
Expand All @@ -27,6 +31,8 @@ jobs:
- name: Compute image version
id: image
uses: actions/github-script@v9
env:
TAG_SUFFIX: ${{ github.event.inputs.tagSuffix }}
with:
script: |
const fs = require('fs');
Expand All @@ -35,7 +41,13 @@ jobs:
if (!/^\d+\.\d+\.\d+$/.test(runnerVersion)) {
throw new Error(`Invalid runner version: ${runnerVersion}`);
}
const suffix = (process.env.TAG_SUFFIX || '').trim();
if (suffix && !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(suffix)) {
throw new Error(`Invalid tag suffix: ${suffix}`);
}
const imageTag = suffix ? `${runnerVersion}-${suffix}` : runnerVersion;
core.setOutput('version', runnerVersion);
core.setOutput('tag', imageTag);

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v4
Expand All @@ -56,7 +68,7 @@ jobs:
linux/amd64
linux/arm64
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.image.outputs.version }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.image.outputs.tag }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
build-args: |
RUNNER_VERSION=${{ steps.image.outputs.version }}
Expand Down
8 changes: 5 additions & 3 deletions images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-noble AS build
ARG TARGETOS
ARG TARGETARCH
ARG RUNNER_VERSION
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.7.0
ARG RUNNER_CONTAINER_HOOKS_REPO=oradwell/runner-container-hooks
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.7.1-alpha
ARG RUNNER_CONTAINER_HOOKS_NOVOLUME_VERSION=0.8.2-alpha
ARG DOCKER_VERSION=29.5.0
ARG BUILDX_VERSION=0.34.0

Expand All @@ -17,11 +19,11 @@ RUN export RUNNER_ARCH=${TARGETARCH} \
&& tar xzf ./runner.tar.gz \
&& rm runner.tar.gz

RUN curl -f -L -o runner-container-hooks.zip https://github.com/actions/runner-container-hooks/releases/download/v${RUNNER_CONTAINER_HOOKS_VERSION}/actions-runner-hooks-k8s-${RUNNER_CONTAINER_HOOKS_VERSION}.zip \
RUN curl -f -L -o runner-container-hooks.zip https://github.com/${RUNNER_CONTAINER_HOOKS_REPO}/releases/download/v${RUNNER_CONTAINER_HOOKS_VERSION}/actions-runner-hooks-k8s-${RUNNER_CONTAINER_HOOKS_VERSION}.zip \
&& unzip ./runner-container-hooks.zip -d ./k8s \
&& rm runner-container-hooks.zip

RUN curl -f -L -o runner-container-hooks.zip https://github.com/actions/runner-container-hooks/releases/download/v0.8.1/actions-runner-hooks-k8s-0.8.1.zip \
RUN curl -f -L -o runner-container-hooks.zip https://github.com/${RUNNER_CONTAINER_HOOKS_REPO}/releases/download/v${RUNNER_CONTAINER_HOOKS_NOVOLUME_VERSION}/actions-runner-hooks-k8s-${RUNNER_CONTAINER_HOOKS_NOVOLUME_VERSION}.zip \
&& unzip ./runner-container-hooks.zip -d ./k8s-novolume \
&& rm runner-container-hooks.zip

Expand Down
Loading