Skip to content

Commit f908f91

Browse files
committed
feat: Linux GitHub Actions runner with Tauri deps (Ubuntu 22.04)
0 parents  commit f908f91

4 files changed

Lines changed: 137 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build & Push Runner Image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- 'Dockerfile'
8+
- 'entrypoint.sh'
9+
10+
permissions:
11+
packages: write
12+
contents: read
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v6
19+
20+
- uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- uses: docker/build-push-action@v6
27+
with:
28+
context: .
29+
push: true
30+
tags: ghcr.io/remmik/linux-github-runner:latest

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM ubuntu:22.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# Base deps + Tauri Linux requirements
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
curl ca-certificates git sudo jq \
8+
libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev \
9+
build-essential pkg-config \
10+
lib32gcc-s1 \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
# Node.js 24
14+
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
15+
&& apt-get install -y nodejs \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
# pnpm
19+
RUN npm install -g pnpm@latest
20+
21+
# Rust
22+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
23+
ENV PATH="/root/.cargo/bin:${PATH}"
24+
RUN cargo install tauri-cli --version "^2" --locked
25+
26+
# GitHub Actions Runner
27+
ARG RUNNER_VERSION=2.325.0
28+
RUN mkdir -p /actions-runner && cd /actions-runner \
29+
&& curl -sL "https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz" | tar xz \
30+
&& ./bin/installdependencies.sh
31+
32+
COPY entrypoint-linux.sh /actions-runner/entrypoint.sh
33+
RUN chmod +x /actions-runner/entrypoint.sh
34+
35+
WORKDIR /actions-runner
36+
ENTRYPOINT ["/actions-runner/entrypoint.sh"]

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# GitHub Actions Runner
2+
3+
Self-hosted GitHub Actions runner image with Tauri build dependencies.
4+
5+
Based on Ubuntu 22.04 with Node 24, pnpm, Rust (stable), Tauri CLI v2, and WebKit/GTK development libraries.
6+
7+
## What's included
8+
9+
- Ubuntu 22.04 (Jammy)
10+
- Node.js 24 + pnpm
11+
- Rust stable + Tauri CLI v2
12+
- libwebkit2gtk-4.1-dev and other Tauri Linux deps
13+
- GitHub Actions Runner
14+
15+
## Usage (Kubernetes)
16+
17+
```yaml
18+
containers:
19+
- name: runner
20+
image: ghcr.io/saturate/github-runner:latest
21+
env:
22+
- name: GITHUB_TOKEN
23+
value: "ghp_..."
24+
- name: GITHUB_REPOSITORY
25+
value: "Saturate/overhead"
26+
- name: RUNNER_NAME
27+
value: "k3s-linux"
28+
- name: RUNNER_LABELS
29+
value: "self-hosted,Linux,X64"
30+
```
31+
32+
## Usage (Docker)
33+
34+
```bash
35+
docker run -d \
36+
-e GITHUB_TOKEN=ghp_... \
37+
-e GITHUB_REPOSITORY=Saturate/overhead \
38+
-e RUNNER_NAME=my-runner \
39+
ghcr.io/saturate/github-runner:latest
40+
```

entrypoint.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ -z "$GITHUB_TOKEN" ]; then echo "GITHUB_TOKEN required"; exit 1; fi
5+
if [ -z "$GITHUB_REPOSITORY" ]; then echo "GITHUB_REPOSITORY required"; exit 1; fi
6+
7+
RUNNER_NAME="${RUNNER_NAME:-k3s-linux}"
8+
RUNNER_LABELS="${RUNNER_LABELS:-self-hosted,Linux,X64}"
9+
10+
# Get registration token
11+
REG_TOKEN=$(curl -s -X POST \
12+
-H "Authorization: token ${GITHUB_TOKEN}" \
13+
-H "Accept: application/vnd.github+json" \
14+
"https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/runners/registration-token" | jq -r .token)
15+
16+
# Configure
17+
./config.sh --url "https://github.com/${GITHUB_REPOSITORY}" \
18+
--token "$REG_TOKEN" \
19+
--name "$RUNNER_NAME" \
20+
--labels "$RUNNER_LABELS" \
21+
--unattended --replace
22+
23+
# Cleanup on exit
24+
cleanup() {
25+
echo "Removing runner..."
26+
./config.sh remove --token "$REG_TOKEN" || true
27+
}
28+
trap cleanup EXIT
29+
30+
# Run
31+
./run.sh

0 commit comments

Comments
 (0)