diff --git a/.github/workflows/build.yaml b/.github/workflows/build-docker.yaml similarity index 88% rename from .github/workflows/build.yaml rename to .github/workflows/build-docker.yaml index c6047481..bfc3ac5e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build-docker.yaml @@ -3,6 +3,8 @@ name: Build Docker image on: push: branches: ['main'] + pull_request: + branches: ['main'] permissions: contents: read @@ -16,15 +18,17 @@ jobs: steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 + - name: Log in to the Container registry uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push Docker image id: push uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 with: - push: true + push: ${{ github.event_name == 'push' }} tags: ghcr.io/${{github.repository}}:latest diff --git a/Dockerfile b/Dockerfile index 4241539e..26cead04 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apk update \ WORKDIR /var/src/lnt -COPY requirements.server.txt setup.py . +COPY requirements*.txt setup.py . # setup.py uses lnt.__version__ etc. COPY lnt/__init__.py lnt/__init__.py # we build the cperf extension during install