Skip to content

Commit 7cd5f1e

Browse files
authored
Also build the Docker image on PRs, but only push it on pushes (llvm#78)
1 parent 77e8659 commit 7cd5f1e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/build.yaml renamed to .github/workflows/build-docker.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Build Docker image
33
on:
44
push:
55
branches: ['main']
6+
pull_request:
7+
branches: ['main']
68

79
permissions:
810
contents: read
@@ -16,15 +18,17 @@ jobs:
1618

1719
steps:
1820
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
21+
1922
- name: Log in to the Container registry
2023
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
2124
with:
2225
registry: ghcr.io
2326
username: ${{ github.actor }}
2427
password: ${{ secrets.GITHUB_TOKEN }}
28+
2529
- name: Build and push Docker image
2630
id: push
2731
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
2832
with:
29-
push: true
33+
push: ${{ github.event_name == 'push' }}
3034
tags: ghcr.io/${{github.repository}}:latest

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN apk update \
66

77
WORKDIR /var/src/lnt
88

9-
COPY requirements.server.txt setup.py .
9+
COPY requirements*.txt setup.py .
1010
# setup.py uses lnt.__version__ etc.
1111
COPY lnt/__init__.py lnt/__init__.py
1212
# we build the cperf extension during install

0 commit comments

Comments
 (0)