Skip to content

Commit 57a2c8a

Browse files
committed
Add some docker stuff for testing PRs
1 parent 9f3771d commit 57a2c8a

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build PR Docker Image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
pr_number:
7+
description: 'Pull request number to build'
8+
required: true
9+
type: number
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
jobs:
16+
build-and-push:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
pull-requests: read
22+
23+
steps:
24+
- name: Checkout PR
25+
uses: actions/checkout@v4
26+
with:
27+
ref: refs/pull/${{ inputs.pr_number }}/merge
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
32+
- name: Log in to GitHub Container Registry
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ${{ env.REGISTRY }}
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Build and push Docker image
40+
uses: docker/build-push-action@v5
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ inputs.pr_number }}
45+
labels: |
46+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}/pull/${{ inputs.pr_number }}
47+
cache-from: type=gha
48+
cache-to: type=gha,mode=max
49+
50+
- name: Build and push Linesync Docker image
51+
uses: docker/build-push-action@v5
52+
with:
53+
context: ./tools/linesync
54+
push: true
55+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-linesync:pr-${{ inputs.pr_number }}
56+
labels: |
57+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}/pull/${{ inputs.pr_number }}
58+
cache-from: type=gha
59+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ tools/sidconvert/num2sid
2020
# iauthd-ts build artifacts
2121
tools/iauthd-ts/dist/
2222
tools/iauthd-ts/node_modules/
23+
build/

0 commit comments

Comments
 (0)