aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-12-22 13:19:30 -0500
committerXe Iaso <me@xeiaso.net>2024-12-22 13:19:30 -0500
commit40e16847369844da7a54b40ad491067c8e01747c (patch)
tree3c8a59097f220542bb66493e140c53224dcbfaee
parentbda7fb414be7d9398a68d58893a69f6d293ca8e6 (diff)
downloadx-40e16847369844da7a54b40ad491067c8e01747c.tar.xz
x-40e16847369844da7a54b40ad491067c8e01747c.zip
try building actions runner image in CI
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--.github/workflows/actions-runner-update.yml31
-rw-r--r--kube/runner-ci/Dockerfile27
-rw-r--r--kube/runner-ci/build.sh7
3 files changed, 65 insertions, 0 deletions
diff --git a/.github/workflows/actions-runner-update.yml b/.github/workflows/actions-runner-update.yml
new file mode 100644
index 0000000..dec9272
--- /dev/null
+++ b/.github/workflows/actions-runner-update.yml
@@ -0,0 +1,31 @@
+name: Regenerate actions-runner image
+
+on:
+ push:
+ branches: [ "master" ]
+ schedule:
+ - cron: "0 0 1,8,15,22 * *"
+
+permissions:
+ pull-requests: write
+ contents: write
+ packages: write
+
+jobs:
+ build-image:
+ runs-on: alrest-x
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Log into registry
+ if: github.event_name != 'pull_request'
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
+ with:
+ registry: ghcr.io
+ username: xe
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: "Build/deploy docker image"
+ run: |
+ cd kube/runner-ci
+ ./build.sh
diff --git a/kube/runner-ci/Dockerfile b/kube/runner-ci/Dockerfile
new file mode 100644
index 0000000..9821199
--- /dev/null
+++ b/kube/runner-ci/Dockerfile
@@ -0,0 +1,27 @@
+ARG VERSION
+FROM --platform=amd64 ghcr.io/actions/actions-runner:${VERSION}
+
+ENV HOMEBREW_NO_ANALYTICS=1 \
+ HOMEBREW_NO_ENV_HINTS=1 \
+ HOMEBREW_NO_INSTALL_CLEANUP=1 \
+ DEBCONF_NONINTERACTIVE_SEEN=true \
+ DEBIAN_FRONTEND="noninteractive" \
+ APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
+
+USER root
+
+RUN \
+ apt-get update \
+ && \
+ apt-get install -y --no-install-recommends --no-install-suggests \
+ ca-certificates \
+ gcc \
+ jo \
+ moreutils \
+ wget \
+ build-essential \
+ && rm -rf /var/lib/apt/lists/*
+
+USER runner
+
+RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" \ No newline at end of file
diff --git a/kube/runner-ci/build.sh b/kube/runner-ci/build.sh
new file mode 100644
index 0000000..c999e99
--- /dev/null
+++ b/kube/runner-ci/build.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+version=$(curl -sX GET "https://api.github.com/repos/actions/runner/releases/latest" | jq --raw-output '.tag_name')
+version="${version#*v}"
+version="${version#*release-}"
+
+docker build --build-arg VERSION=${version} -t ghcr.io/xe/actions-runner .
+docker push ghcr.io/xe/x/actions-runner \ No newline at end of file