mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
ci: fix version injection to be a docker build arg
This commit is contained in:
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -74,6 +74,8 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
build-args: |
|
||||||
|
APP_VERSION=${{ needs.determine-release-type.outputs.tagname }}
|
||||||
|
|
||||||
publish-release:
|
publish-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ CMD ["bun", "run", "dev"]
|
|||||||
# ------------------------------
|
# ------------------------------
|
||||||
FROM oven/bun:${BUN_VERSION} AS builder
|
FROM oven/bun:${BUN_VERSION} AS builder
|
||||||
|
|
||||||
|
ARG APP_VERSION=dev
|
||||||
|
ENV VITE_APP_VERSION=${APP_VERSION}
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY ./package.json ./bun.lock ./
|
COPY ./package.json ./bun.lock ./
|
||||||
|
|||||||
@@ -3,14 +3,9 @@ import tailwindcss from "@tailwindcss/vite";
|
|||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import tsconfigPaths from "vite-tsconfig-paths";
|
import tsconfigPaths from "vite-tsconfig-paths";
|
||||||
import { reactRouterHonoServer } from "react-router-hono-server/dev";
|
import { reactRouterHonoServer } from "react-router-hono-server/dev";
|
||||||
import { execSync } from "node:child_process";
|
|
||||||
|
|
||||||
const getVersion = () => {
|
const getVersion = () => {
|
||||||
try {
|
return process.env.VITE_APP_VERSION || "dev";
|
||||||
return execSync("git describe --tags --always").toString().trim();
|
|
||||||
} catch {
|
|
||||||
return "dev";
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
|||||||
Reference in New Issue
Block a user