diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d685d69..7081128 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,10 @@ on: branches: - main + pull_request: + branches: + - main + schedule: - cron: '30 5 * * *' @@ -55,9 +59,30 @@ jobs: QGIS_VERSION_SHORT=${{ env.QGIS_VERSION_SHORT }} cache-to: type=local,dest=cache - - name: Build and push release - uses: docker/build-push-action@v3 + - name: Build release + uses: docker/build-push-action@v6 if: env.DO_BUILD == 'true' + with: + context: . + push: false + load: true + build-args: | + QGIS_VERSION=${{ env.QGIS_VERSION_TAG }} + QGIS_VERSION_SHORT=${{ env.QGIS_VERSION_SHORT }} + cache-from: type=local,src=cache + tags: | + ghcr.io/opengisch/qgis-slim:latest + ghcr.io/opengisch/qgis-slim:${{ matrix.release_line }} + ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_SHORT }} + ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_PATCH }} + + - name: Test + run: | + docker run --rm ghcr.io/opengisch/qgis-slim:latest python3 -c 'from qgis.core import QgsApplication; QgsApplication([], False)' + + - name: Push release + uses: docker/build-push-action@v6 + if: env.DO_BUILD == 'true' && github.event_name != 'pull_request' with: context: . push: true @@ -71,6 +96,7 @@ jobs: ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_SHORT }} ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_PATCH }} + # - name: Build and push debug # uses: docker/build-push-action@v3 # if: env.DO_BUILD == 'true' diff --git a/Dockerfile b/Dockerfile index 3b1d220..7b5e7ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -237,6 +237,9 @@ WORKDIR /data ENTRYPOINT [ "/tini", "--", "/usr/local/bin/uid_entrypoint.sh" ] +ENV PYTHONPATH="/usr/share/qgis/python/" +ENV QT_QPA_PLATFORM=offscreen + EXPOSE 5000 CMD [ "/usr/local/bin/run.sh" ]