ci: fix version injection to be a docker build arg

This commit is contained in:
Nicolas Meienberger
2025-11-16 16:53:29 +01:00
parent 0d36484c04
commit a3e027694a
3 changed files with 6 additions and 6 deletions

View File

@@ -74,6 +74,8 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
APP_VERSION=${{ needs.determine-release-type.outputs.tagname }}
publish-release:
runs-on: ubuntu-latest

View File

@@ -59,6 +59,9 @@ CMD ["bun", "run", "dev"]
# ------------------------------
FROM oven/bun:${BUN_VERSION} AS builder
ARG APP_VERSION=dev
ENV VITE_APP_VERSION=${APP_VERSION}
WORKDIR /app
COPY ./package.json ./bun.lock ./

View File

@@ -3,14 +3,9 @@ import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { reactRouterHonoServer } from "react-router-hono-server/dev";
import { execSync } from "node:child_process";
const getVersion = () => {
try {
return execSync("git describe --tags --always").toString().trim();
} catch {
return "dev";
}
return process.env.VITE_APP_VERSION || "dev";
};
export default defineConfig({