Repository navigation
64 lines (55 loc) · 2.03 KB
/
Copy pathrunner-image.yml
File metadata and controls
64 lines (55 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Runner image (GHCR)
# Builds the bug-finding runner image (mini-swe/LiteLLM agent + pinned pred) and pushes it
# to GHCR, so `make run` can start with `make runner-pull` instead of a ~30–60 min local
# Rust build. Tag = the benchmark version from VERSION (also the default PR_REF) + latest.
#
# One-time setup: after the first push, mark the package public
# (Packages → problem-reductions-runner → Package settings) so anyone can pull it.
on:
push:
branches: [main]
paths:
- docker/Dockerfile
- benchmark/requirements.txt
- .github/workflows/runner-image.yml
- Makefile
- VERSION
workflow_dispatch: {}
permissions:
contents: read
packages: write
jobs:
runner:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Read benchmark version
id: pins
run: echo "pr_ref=$(cat VERSION)" >> "$GITHUB_OUTPUT"
# Docker repository names must be lowercase — the org login (CodingThrust) is not.
- name: Lowercase GHCR image namespace
id: ghcr
run: echo "image=ghcr.io/$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')/problem-reductions-runner" >> "$GITHUB_OUTPUT"
- uses: docker/setup-buildx-action@v4
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the runner image
uses: docker/build-push-action@v7
with:
context: .
file: docker/Dockerfile
target: runner
build-args: |
PR_REF=${{ steps.pins.outputs.pr_ref }}
CARGO_JOBS=4
push: true
tags: |
${{ steps.ghcr.outputs.image }}:${{ steps.pins.outputs.pr_ref }}
${{ steps.ghcr.outputs.image }}:latest
labels: org.opencontainers.image.source=https://github.com/${{ github.repository }}
cache-from: type=gha
cache-to: type=gha,mode=max