Skip to content

Commit 39d821f

Browse files
authored
Add GitHub action to build and publish docker image (#55)
To help get the ball rolling with deploying LNT, this adds a GitHub action to build and push images to the GitHub container registry, which is free for public repos. This will push a new image to ghcr.io/llvm-project/llvm-lnt:latest whenever anything is pushed to the main branch. It also includes a fix for the Dockerfile after the minimum python version was bumped to 3.8 in #48. 3.10 is as high as we can go before we need to upgrade psycopg to 3.x, which in turn requires upgrading sqlalchemy to god knows what. We also need to upgrade psycopg 2.x anyway to get it to build with the newer python bindings.
1 parent 2876164 commit 39d821f

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

.github/workflows/build.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Docker image
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
packages: write
14+
id-token: write
15+
16+
steps:
17+
- uses: actions/checkout@v5
18+
- name: Log in to the Container registry
19+
uses: docker/login-action@v3
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Build and push Docker image
25+
id: push
26+
uses: docker/build-push-action@v6
27+
with:
28+
context: docker
29+
push: true
30+
tags: ghcr.io/${{github.repository}}:latest

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7-alpine
1+
FROM python:3.10-alpine
22

33
RUN apk update \
44
&& apk add --no-cache --virtual .build-deps git g++ postgresql-dev yaml-dev \

requirements.server.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# These requirements are what you would install on a production server.
22
.
3-
psycopg2==2.8
3+
psycopg2==2.9.10
44
gunicorn==19.9.0
55
Jinja2==3.1.6
66
progressbar2

0 commit comments

Comments
 (0)