diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml index de5914f..d541ee5 100644 --- a/.github/workflows/container.yaml +++ b/.github/workflows/container.yaml @@ -14,6 +14,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Build package with deps + run: | + python -m pip install --upgrade pip + pip wheel --wheel-dir wheel --editable . - name: Docker meta id: meta @@ -58,3 +70,13 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max + + render: + runs-on: ubuntu-latest + needs: docker + steps: + - name: Deploy to Render + uses: johnbeynon/render-webhook-action@v0.0.6 + with: + service-id: ${{ secrets.RENDER_SERVICE_ID }} + key: ${{ secrets.RENDER_SERVICE_KEY }} diff --git a/.gitignore b/.gitignore index 80df197..c31c053 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ build/ .mypy_cache .ruff_cache + +wheels/ diff --git a/Dockerfile b/Dockerfile index aff612e..a87b722 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,22 +5,14 @@ LABEL org.opencontainers.image.source=https://github.com/mareuter/lct-web LABEL org.opencontainers.image.description="Webservice for Lunar Club information." LABEL org.opencontainers.image.license=BSD-3-Clause -WORKDIR / -RUN apt update && \ - apt-get install --yes git && \ - pip install --upgrade pip - RUN adduser fastapi USER fastapi WORKDIR /home/fastapi -COPY --chown=fastapi:fastapi pyproject.toml . -COPY --chown=fastapi:fastpi .git .git -COPY --chown=fastapi:fastapi src src - ENV PATH="/home/fastapi/.local/bin:${PATH}" -RUN pip install --user . +RUN --mount=source=wheels,target=wheels,type=bind \ + pip install --no-cache-dir --user wheels/* EXPOSE 8000