From a69a38a3a22fec2ffb6af405f95c0bae56ce6bf1 Mon Sep 17 00:00:00 2001 From: Peter Kurfer Date: Wed, 15 May 2024 17:58:55 +0200 Subject: [PATCH] feat(ente): build web image from tag --- .forgejo/workflows/act_runtime.yaml | 3 +++ .forgejo/workflows/ente.yaml | 16 +++++++++++++--- ente/web/Dockerfile | 4 +++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/act_runtime.yaml b/.forgejo/workflows/act_runtime.yaml index 7fe6faa..db86759 100644 --- a/.forgejo/workflows/act_runtime.yaml +++ b/.forgejo/workflows/act_runtime.yaml @@ -6,6 +6,9 @@ on: push: branches: - main + paths: + - ".forgejo/workflows/act_runtime.yaml" + - "act_runtime/**" env: TAGS: '{"ubuntu-latest": {"node:20-bullseye-slim": "20.04-arm64","node:20-bookworm-slim": "arm64"},"ubuntu-latest-amd64": {"node:20-bullseye-slim": "20.04-amd64","node:20-bookworm-slim": "amd64"}}' diff --git a/.forgejo/workflows/ente.yaml b/.forgejo/workflows/ente.yaml index 8e3d860..c22e9ea 100644 --- a/.forgejo/workflows/ente.yaml +++ b/.forgejo/workflows/ente.yaml @@ -1,9 +1,14 @@ --- name: Image builds on: + schedule: + - cron: "21 2 * * *" push: branches: - main + paths: + - ".forgejo/workflows/ente.yaml" + - "ente/**" jobs: build-ente-images: @@ -27,6 +32,11 @@ jobs: env: GH_TOKEN: ${{ secrets.RENOVATE_GITHUB_TOKEN }} - - name: Test ente version - run: | - echo "$ENTE_PHOTOS_VERSION" \ No newline at end of file + - name: Build and push ente web + uses: docker/build-push-action@v5 + with: + context: "./ente/web" + push: true + tags: code.icb4dc0.de/infrastructure/images/ente/web:${{ env.ENTE_PHOTOS_VERSION }} + build-args: | + ENTE_BRANCH=${{ env.ENTE_PHOTOS_VERSION }} \ No newline at end of file diff --git a/ente/web/Dockerfile b/ente/web/Dockerfile index 0f6d15e..727f49c 100644 --- a/ente/web/Dockerfile +++ b/ente/web/Dockerfile @@ -1,6 +1,8 @@ # syntax=docker/dockerfile:1 FROM node:21-bookworm-slim as ente-builder +ARG ENTE_BRANCH=main + ENV NEXT_PUBLIC_ENTE_ENDPOINT=DOCKER_RUNTIME_REPLACE_ENDPOINT \ NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=DOCKER_RUNTIME_REPLACE_ALBUMS_ENDPOINT @@ -8,7 +10,7 @@ RUN apt update && apt install -y ca-certificates git git-lfs && rm -rf /var/lib/ WORKDIR /app -RUN git clone --recursive --depth=1 --shallow-submodules https://github.com/ente-io/ente.git . +RUN git clone --recursive --depth=1 --shallow-submodules --branch="${ENTE_BRANCH}" https://github.com/ente-io/ente.git . WORKDIR /app/web