This commit is contained in:
GuoQing Liu 2025-11-12 16:07:53 +00:00 committed by GitHub
commit 80182da27c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 2 deletions

View File

@ -4,6 +4,8 @@ inputs:
GITHUB_TOKEN:
required: true
outputs:
short-sha:
value: ${{ steps.create-short-sha.outputs.SHORT_SHA }}
image-name:
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ steps.create-short-sha.outputs.SHORT_SHA }}
cache-name:

View File

@ -37,6 +37,8 @@ jobs:
context: .
file: docker/main/Dockerfile
push: true
build-args:
GIT_COMMIT_HASH=${{ steps.setup.outputs.short-sha }}
platforms: linux/amd64
target: frigate
tags: ${{ steps.setup.outputs.image-name }}-amd64
@ -61,6 +63,8 @@ jobs:
context: .
file: docker/main/Dockerfile
push: true
build-args:
GIT_COMMIT_HASH=${{ steps.setup.outputs.short-sha }}
platforms: linux/arm64
target: frigate
tags: |

View File

@ -318,6 +318,10 @@ FROM --platform=$BUILDPLATFORM node:20 AS web-build
WORKDIR /work
COPY web/package.json web/package-lock.json ./
ARG GIT_COMMIT_HASH
ENV GIT_COMMIT_HASH=$GIT_COMMIT_HASH
RUN npm install
COPY web/ ./

View File

@ -33,7 +33,7 @@ i18n
fallbackLng: "en", // use en if detected lng is not available
backend: {
loadPath: "locales/{{lng}}/{{ns}}.json",
loadPath: `locales/{{lng}}/{{ns}}.json?v=${import.meta.env.GIT_COMMIT_HASH || "unknown"}`,
},
ns: [

View File

@ -5,11 +5,12 @@ import react from "@vitejs/plugin-react-swc";
import monacoEditorPlugin from "vite-plugin-monaco-editor";
const proxyHost = process.env.PROXY_HOST || "localhost:5000";
const gitCommitHash = process.env.GIT_COMMIT_HASH || "unknown";
// https://vitejs.dev/config/
export default defineConfig({
define: {
"import.meta.vitest": "undefined",
"import.meta.env.GIT_COMMIT_HASH": JSON.stringify(gitCommitHash),
},
server: {
proxy: {