Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_APP_VERSION=${{ steps.meta.outputs.version }}
cache-from: type=gha,scope=frontend
cache-to: type=gha,mode=max,scope=frontend

Expand Down
8 changes: 8 additions & 0 deletions backend/internal/api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,3 +436,11 @@ func ResetDatabase(w http.ResponseWriter, r *http.Request) {

jsonResponse(w, http.StatusOK, map[string]string{"message": "Database reset successfully"})
}

func GetVersion(w http.ResponseWriter, r *http.Request) {
version := os.Getenv("APP_VERSION")
if version == "" {
version = "dev"
}
jsonResponse(w, http.StatusOK, map[string]string{"version": version})
}
2 changes: 2 additions & 0 deletions backend/internal/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func NewRouter() *chi.Mux {
r.Post("/import", ImportDatabase)
r.Post("/reset", ResetDatabase)
})

r.Get("/version", GetVersion)
})

return r
Expand Down
2 changes: 2 additions & 0 deletions charts/freezo/templates/deployment-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ spec:
env:
- name: DB_PATH
value: "/data/freezer.db"
- name: APP_VERSION
value: {{ .Chart.AppVersion | quote }}
volumeMounts:
- name: data
mountPath: /data
Expand Down
4 changes: 3 additions & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Build stage
FROM node:22-bookworm-slim AS build

WORKDIR /app

ARG VITE_APP_VERSION=dev
ENV VITE_APP_VERSION=$VITE_APP_VERSION

COPY package.json package-lock.json ./
RUN npm ci --legacy-peer-deps

Expand Down
Loading
Loading