diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index befe4f57a..724af45a5 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -4,8 +4,6 @@ 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: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f98939d33..dcf3070b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,8 +37,6 @@ 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 @@ -63,8 +61,6 @@ jobs: context: . file: docker/main/Dockerfile push: true - build-args: - GIT_COMMIT_HASH=${{ steps.setup.outputs.short-sha }} platforms: linux/arm64 target: frigate tags: | diff --git a/.gitignore b/.gitignore index 8456d9be0..660a378b0 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ frigate/version.py web/build web/node_modules web/coverage +web/.env core !/web/**/*.ts .idea/* diff --git a/Makefile b/Makefile index 2baac5aad..d1427b6df 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ push-boards: $(BOARDS:%=push-%) version: echo 'VERSION = "$(VERSION)-$(COMMIT_HASH)"' > frigate/version.py + echo 'VITE_GIT_COMMIT_HASH=$(COMMIT_HASH)' > web/.env local: version docker buildx build --target=frigate --file docker/main/Dockerfile . \ diff --git a/docker/main/Dockerfile b/docker/main/Dockerfile index f1a3ee4a1..7cd9c22e1 100644 --- a/docker/main/Dockerfile +++ b/docker/main/Dockerfile @@ -319,9 +319,6 @@ 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/ ./ diff --git a/web/.gitignore b/web/.gitignore index a547bf36d..1cac5597e 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -22,3 +22,4 @@ dist-ssr *.njsproj *.sln *.sw? +.env \ No newline at end of file diff --git a/web/src/utils/i18n.ts b/web/src/utils/i18n.ts index d48e37d83..eba5ff7a5 100644 --- a/web/src/utils/i18n.ts +++ b/web/src/utils/i18n.ts @@ -33,7 +33,7 @@ i18n fallbackLng: "en", // use en if detected lng is not available backend: { - loadPath: `locales/{{lng}}/{{ns}}.json?v=${import.meta.env.GIT_COMMIT_HASH || "unknown"}`, + loadPath: `locales/{{lng}}/{{ns}}.json?v=${import.meta.env.VITE_GIT_COMMIT_HASH || "unknown"}`, }, ns: [ diff --git a/web/vite.config.ts b/web/vite.config.ts index 082b7a159..b3a14b4a7 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -5,12 +5,10 @@ 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: {