diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9096364..de29e55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 2803f68..849d93f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 ./ diff --git a/vite.config.ts b/vite.config.ts index 9782fec..f456fcc 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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({