Skip to content

Commit 88b9604

Browse files
committed
Move contributor image creation to GitHub actions
We could speed this up with creating the amd64 image in parallel but the bottleneck is always the arm64 as GitHub doesn't seem to have arm runners available yet. We now create a PR image which can be tested before in case this is needed.
1 parent da865fb commit 88b9604

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 'Build Contributor container (PR)'
2+
# For speedup to do this in parallel: https://docs.docker.com/build/ci/github-actions/multi-platform/
3+
# Loosely based on: https://docs.docker.com/build/ci/github-actions/push-multi-registries/
4+
5+
on:
6+
push:
7+
pull_request_target:
8+
branches:
9+
- main
10+
11+
jobs:
12+
pr-contributor:
13+
if: ${{ github.repository != 'domjudge/domjudge-packaging' || github.ref != 'main' }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v3
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
- name: Login to Docker Hub
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.repository_owner }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Extract metadata (tags, labels) for Docker
30+
id: meta
31+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
32+
with:
33+
images: ghcr.io/${{ github.repository }}
34+
35+
- name: Build and push
36+
uses: docker/build-push-action@v5
37+
with:
38+
context: docker-contributor
39+
platforms: linux/amd64,linux/arm64
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Build Contributor container (Release)'
2+
# For speedup to do this in parallel: https://docs.docker.com/build/ci/github-actions/multi-platform/
3+
# Loosely based on: https://docs.docker.com/build/ci/github-actions/push-multi-registries/
4+
5+
on:
6+
push:
7+
pull_request_target:
8+
branches:
9+
- main
10+
11+
jobs:
12+
release-contributor:
13+
if: ${{ github.repository == 'domjudge/domjudge-packaging' && github.ref == 'main' }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v3
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
- name: Login to Docker Hub
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ghcr.io
26+
username: ${{ env.DOCKERHUB_USERNAME }}
27+
password: ${{ env.DOCKERHUB_TOKEN }}
28+
29+
- name: Build and push
30+
uses: docker/build-push-action@v5
31+
with:
32+
context: docker-contributor
33+
platforms: linux/amd64,linux/arm64
34+
push: true
35+
tags: domjudge/domjudge-contributor:latest

0 commit comments

Comments
 (0)