From d31ec89f23fbc225fcbe2fed9a9f8a44cb4b62a1 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Mon, 30 Mar 2026 08:32:53 +0200 Subject: [PATCH 1/3] [CI] up actions versions --- .github/workflows/docker.yml | 12 ++++++------ .github/workflows/main.yml | 8 ++++---- Dockerfile | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 07a03f0..2b8a2a5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,7 +12,7 @@ jobs: name: ubuntu-latest - Docker - lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Run hadolint uses: reviewdog/action-hadolint@v1 @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set Environment Variables run: | @@ -38,7 +38,7 @@ jobs: - name: Set up QEMU id: qemu-setup - uses: docker/setup-qemu-action@master + uses: docker/setup-qemu-action@v3 with: platforms: all @@ -47,7 +47,7 @@ jobs: - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@master + uses: docker/setup-buildx-action@v3 with: driver: docker-container use: true @@ -61,7 +61,7 @@ jobs: - name: Build and push latest if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags') && github.ref == 'refs/heads/master' - uses: docker/build-push-action@master + uses: docker/build-push-action@v6 with: context: . builder: ${{ steps.buildx.outputs.name }} @@ -73,7 +73,7 @@ jobs: - name: Build and push on tag if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: docker/build-push-action@master + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa63c00..c80f547 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,9 +23,9 @@ jobs: type: [ sources ] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.13.x architecture: x64 @@ -63,9 +63,9 @@ jobs: name: Source distribution - Python - deploy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.13.x architecture: x64 diff --git a/Dockerfile b/Dockerfile index 8614ad1..0c953fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.13-slim-buster AS base +FROM python:3.13-slim-bullseye AS base WORKDIR /app From c6f8e669023a08408e653ed5572f157e47fbc053 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Mon, 30 Mar 2026 08:33:56 +0200 Subject: [PATCH 2/3] TMP --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2b8a2a5..f8e7e46 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -72,7 +72,7 @@ jobs: TENTACLES_URL_TAG=${{ env.LATEST }} - name: Build and push on tag - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') uses: docker/build-push-action@v6 with: context: . From fff39c926036153f7a3a152b36cd464218670025 Mon Sep 17 00:00:00 2001 From: Herklos Date: Mon, 30 Mar 2026 09:00:53 +0200 Subject: [PATCH 3/3] [Docker] Add npm build Signed-off-by: Herklos --- .dockerignore | 3 +++ .github/workflows/docker.yml | 2 +- Dockerfile | 10 ++++++++++ setup.py | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 4a257c2..4a97e1b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -103,3 +103,6 @@ ENV/ # documentation docs + +# Node +node_modules diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f8e7e46..61a177a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -54,7 +54,7 @@ jobs: - name: Login to DockerHub if: github.event_name == 'push' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/Dockerfile b/Dockerfile index 0c953fb..2e14352 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,12 @@ +FROM node:22-slim AS frontend + +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci +COPY octobot_script/resources/report/ octobot_script/resources/report/ +COPY vite.config.ts tsconfig*.json ./ +RUN npm run build + FROM python:3.13-slim-bullseye AS base WORKDIR /app @@ -7,6 +16,7 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends build-essential git gcc binutils COPY . . +COPY --from=frontend /app/octobot_script/resources/report/dist/ octobot_script/resources/report/dist/ RUN pip3 install --no-cache-dir -U setuptools wheel pip \ && pip3 install --no-cache-dir -r requirements.txt \ diff --git a/setup.py b/setup.py index 54b54c2..aea5dec 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,10 @@ def _build_report(): + if os.path.isfile(REPORT_DIST): + print(f"[report] Pre-built bundle found → {REPORT_DIST}, skipping JS build.") + return + npm = "npm" print("[report] Installing JS dependencies…")